Index: openacs-4/packages/lorsm/tcl/lorsm-import-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/tcl/lorsm-import-procs.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/lorsm/tcl/lorsm-import-procs.tcl 14 Feb 2009 22:33:20 -0000 1.6 +++ openacs-4/packages/lorsm/tcl/lorsm-import-procs.tcl 16 Feb 2009 00:24:54 -0000 1.7 @@ -26,11 +26,11 @@ ad_proc -public lorsm::import_imscp { -upload_file:required -tmp_dir:required + -community_id:required } { } { set user_id [ad_conn user_id] - set community_id [lors::get_community_id] # Gets file-storage root folder_id # eventually, we should provide an option so it can be imported in @@ -331,73 +331,7 @@ -parent_id $parent_id \ -folder_name "${cr_dir}_items"] - # PERMISSIONS FOR FILE-STORAGE - # Before we go about anything else, lets just set permissions straight. - # Disable folder permissions inheritance - permission::toggle_inherit -object_id $new_parent_id - permission::toggle_inherit -object_id $new_items_parent_id - - # Set read permissions for community/class dotlrn_member_rel - - set community_id [lors::get_community_id] - - set party_id_member [db_string party_id_member {}] - - permission::grant \ - -party_id $party_id_member \ - -object_id $new_parent_id \ - -privilege read - - permission::grant \ - -party_id $party_id_member \ - -object_id $new_items_parent_id \ - -privilege read - - # Set read permissions for community/class dotlrn_admin_rel - - set party_id_admin [db_string party_id_admin {}] - - permission::grant \ - -party_id $party_id_admin \ - -object_id $new_parent_id \ - -privilege read - - permission::grant \ - -party_id $party_id_admin \ - -object_id $new_items_parent_id \ - -privilege read - - # Set read permissions for *all* other professors within .LRN - # (so they can see the content) - - set party_id_professor [db_string party_id_professor {}] - - permission::grant \ - -party_id $party_id_professor \ - -object_id $new_parent_id \ - -privilege read - - permission::grant \ - -party_id $party_id_professor \ - -object_id $new_items_parent_id \ - -privilege read - - # Set read permissions for *all* other admins within .LRN - # (so they can see the content) - - set party_id_admins [db_string party_id_admin_profile {}] - - permission::grant \ - -party_id $party_id_admins \ - -object_id $new_parent_id \ - -privilege read - - permission::grant \ - -party_id $party_id_admins \ - -object_id $new_items_parent_id \ - -privilege read - set filesx [lors::cr::add_files \ -parent_id $new_parent_id \ -indb_p $indb_p \ @@ -594,55 +528,7 @@ ns_write "[_ lorsm.lt_Granting_permissions__1]
" - # PERMISSIONS FOR MANIFEST and learning objects - # set up in the same way as permissions for the file storage - # objects. As we want to maintain consistency btw the - # learnining objects and their content - - # Disable folder permissions inheritance - permission::toggle_inherit -object_id $man_id - - # Set read permissions for community/class dotlrn_member_rel - - set community_id [lors::get_community_id] - - set party_id_member [db_string party_id_member {}] - - permission::grant \ - -party_id $party_id_member \ - -object_id $man_id \ - -privilege read - - # Set read permissions for community/class dotlrn_admin_rel - - set party_id_admin [db_string party_id_admin {}] - - permission::grant \ - -party_id $party_id_admin \ - -object_id $man_id \ - -privilege read - - # Set read permissions for *all* other professors within .LRN - # (so they can see the content) - - set party_id_professor [db_string party_id_professor {}] - - permission::grant \ - -party_id $party_id_professor \ - -object_id $man_id \ - -privilege read - - # Set read permissions for *all* other admins within .LRN - # (so they can see the content) - - set party_id_admins [db_string party_id_admin_profile {}] - - permission::grant \ - -party_id $party_id_admins \ - -object_id $man_id \ - -privilege read - # Done with Manifest and learning object Permissions ns_write "[_ lorsm.lt_Adding_course_name_Ma]
" @@ -876,6 +762,13 @@ ns_log Debug "Delete temporary folder $tmp_dir" lors::imscp::deltmpdir $tmp_dir ns_write "[_ lorsm.Done]
" + + callback lorsm::permissions_kludge \ + -community_id $community_id \ + -parent_id $new_parent_id \ + -items_parent_id $new_items_parent_id \ + -man_id $man_id + } return $man_id }