Index: openacs-4/packages/imsld/tcl/imsld-parse-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/tcl/imsld-parse-procs.tcl,v
diff -u -r1.29 -r1.30
--- openacs-4/packages/imsld/tcl/imsld-parse-procs.tcl 1 Feb 2006 12:31:32 -0000 1.29
+++ openacs-4/packages/imsld/tcl/imsld-parse-procs.tcl 6 Feb 2006 17:07:44 -0000 1.30
@@ -566,6 +566,15 @@
set acs_object_id [callback -catch imsld::import -res_type $resource_type -res_href $resource_href -tmp_dir $tmp_dir -community_id $community_id]
# Integration with other packages
# This callback gets the href of the imported content (if some package imported it)
+
+ #revoke permissions until first usage of resources
+ if {[info exist acs_object_id]} {
+ permission::set_not_inherit -object_id $acs_object_id
+ set party_id [db_list get_allowed_parties {}]
+ foreach parti $party_id {
+ permission::revoke -party_id $parti -object_id $acs_object_id -privilege "read"
+ }
+ }
set resource_id [imsld::cp::resource_new -manifest_id $manifest_id \
-identifier $resource_identifier \
@@ -593,6 +602,16 @@
if { !$filex_id } {
# an error ocurred when creating the file
return [list 0 "[_ imsld.lt_The_file_filex_href_w]"]
+ } else {
+ permission::set_not_inherit -object_id $filex_id
+
+ set acs_object_id $filex_id
+ set party_id [db_list get_allowed_parties {}]
+ foreach parti $party_id {
+ permission::revoke -party_id $parti -object_id $filex_id -privilege "read"
+ }
+
+
}
# map resource with file
relation_add imsld_res_files_rel $resource_id $filex_id
@@ -1641,6 +1660,14 @@
-package_id [dotlrn_community::get_package_id $community_id] \
-package_key "forums"]
set acs_object_id [forum::new -name $title -package_id $forums_package_id]
+#revoke read permissions until first usage
+ if {[info exist acs_object_id]} {
+ permission::set_not_inherit -object_id $acs_object_id
+ set party_id [db_list get_allowed_parties {}]
+ foreach parti $party_id {
+ permission::revoke -party_id $parti -object_id $acs_object_id -privilege "read"
+ }
+ }
set resource_id [imsld::cp::resource_new -manifest_id $manifest_id \
-identifier "forumresource-$service_id" \
Index: openacs-4/packages/imsld/tcl/imsld-parse-procs.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/tcl/imsld-parse-procs.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/imsld/tcl/imsld-parse-procs.xql 1 Feb 2006 11:34:48 -0000 1.1
+++ openacs-4/packages/imsld/tcl/imsld-parse-procs.xql 6 Feb 2006 17:07:44 -0000 1.2
@@ -13,7 +13,29 @@
+
+
+ select aopp.party_id
+ from acs_object_party_privilege_map aopp,
+ party_names pn
+ where aopp.privilege='read' and
+ aopp.party_id=pn.party_id and
+ aopp.object_id=:acs_object_id
+
+
+
+
+ select aopp.party_id
+ from acs_object_party_privilege_map aopp,
+ party_names pn
+ where aopp.privilege='read' and
+ aopp.party_id=pn.party_id and
+ aopp.object_id=:acs_object_id
+
+
+
+
select env.component_id
Index: openacs-4/packages/imsld/tcl/imsld-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/tcl/imsld-procs.tcl,v
diff -u -r1.27 -r1.28
--- openacs-4/packages/imsld/tcl/imsld-procs.tcl 6 Feb 2006 16:46:06 -0000 1.27
+++ openacs-4/packages/imsld/tcl/imsld-procs.tcl 6 Feb 2006 17:07:44 -0000 1.28
@@ -1800,7 +1800,7 @@
if {[string eq "t" $resource_mode]} {
#put in order the environments_id(s)
set environments_ids [concat [lindex [lindex $environments_list 1] [expr [llength [lindex $environments_list 1] ] - 1 ]] \
- [lindex [lindex $environments_list 1] [expr [llength [lindex $environments_list 2] ] - 1 ]] ]
+ [lindex [lindex $environments_list 2] [expr [llength [lindex $environments_list 2] ] - 1 ]] ]
return [list [lindex $prerequisites_list [expr [llength $prerequisites_list] - 1]] \
[lindex $objectives_list [expr [llength $objectives_list ] - 1]]\
@@ -2064,6 +2064,9 @@
set resources_activities_list [imsld::process_learning_activity -activity_item_id $activity_item_id -resource_mode "t"]
foreach resource_activity [join $resources_activities_list] {
+
+
+#assessment must have an extra feedback item
if {[db_0or1row is_assessment {} ] } {
db_1row get_as_site_node {}
set as_feedback_url "[site_node::get_url -node_id $node_id][export_vars -base sessions {assessment_id $assessment_id}]"
@@ -2268,6 +2271,26 @@
where la.activity_id = :activity_id
}
set activities_list [imsld::process_learning_activity -activity_item_id $activity_item_id]
+
+ set resources_activities_list [imsld::process_learning_activity -activity_item_id $activity_item_id -resource_mode "t"]
+ foreach resource_activity [join $resources_activities_list] {
+
+#grant permissions for newly appeared resources
+ ns_log Notice "join $resources_activities_list"
+ ns_log Notice "[join $resources_activities_list]"
+ foreach the_resource_id [join $resources_activities_list] {
+ if {![db_0or1row get_object_from_resource {}]} {
+ db_1row get_cr_item_from_resource {}
+ ns_log Notice "grant: usuario $user_id, cr_item $the_object_id"
+ permission::grant -party_id $user_id -object_id $the_object_id -privilege "read"
+ } else {
+ ns_log Notice "grant: usuario $user_id, objeto $the_object_id"
+ permission::grant -party_id $user_id -object_id $the_object_id -privilege "read"
+ }
+ }
+ }
+
+
set prerequisites ""
if { [llength [lindex $activities_list 0]] } {
set prerequisites "[lindex [lindex $activities_list 0] 0]
"
Index: openacs-4/packages/imsld/tcl/imsld-procs.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/tcl/imsld-procs.xql,v
diff -u -r1.5 -r1.6
--- openacs-4/packages/imsld/tcl/imsld-procs.xql 6 Feb 2006 16:46:06 -0000 1.5
+++ openacs-4/packages/imsld/tcl/imsld-procs.xql 6 Feb 2006 17:07:44 -0000 1.6
@@ -1699,7 +1699,25 @@
+
+
+ select ar.object_id_two as the_object_id
+ from acs_rels ar
+ where ar.object_id_one=:the_resource_id and
+ ar.rel_type='imsld_res_files_rel'
+
+
+
+
+
+ select acs_object_id as the_object_id
+ from imsld_cp_resourcesi
+ where item_id = :the_resource_id and
+ acs_object_id is not null
+
+
+
select resource_id