Index: openacs-4/packages/dotlrn-lorsm/dotlrn-lorsm.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-lorsm/dotlrn-lorsm.info,v
diff -u -r1.10 -r1.11
--- openacs-4/packages/dotlrn-lorsm/dotlrn-lorsm.info 9 Nov 2008 23:29:24 -0000 1.10
+++ openacs-4/packages/dotlrn-lorsm/dotlrn-lorsm.info 16 Feb 2009 00:24:54 -0000 1.11
@@ -7,14 +7,14 @@
f
t
-
+
Ernie Ghiglione
2008-10-18
OpenACS
-
-
-
+
+
+
Index: openacs-4/packages/dotlrn-lorsm/tcl/dotlrn-lorsm-callback-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-lorsm/tcl/dotlrn-lorsm-callback-procs.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-lorsm/tcl/dotlrn-lorsm-callback-procs.tcl 16 Feb 2009 00:24:54 -0000 1.1
@@ -0,0 +1,122 @@
+
+ad_library {
+
+ Callback implementations.
+
+ @author Don Baccus (dhogaza@pacifier.com)
+
+}
+
+ad_proc -public -callback lorsm::permissions_kludge -impl dotlrn-lorsm {
+} {
+ @author Don Baccus
+
+ Kludge permissions of a course uploaded by lorsm.
+} {
+ns_log Notice "Huh? in callback: parent_id $parent_id items_parent_id $items_parent_id man_id $man_id community_id $community_id"
+
+ set party_id_admin [db_string party_id_admin {}]
+ set party_id_member [db_string party_id_member {}]
+ set party_id_admin [db_string party_id_admin {}]
+ set party_id_professor [db_string party_id_professor {}]
+ set party_id_admins [db_string party_id_admins {}]
+
+ # Before we go about anything else, lets just set permissions straight.
+ # Disable folder permissions inheritance
+ permission::toggle_inherit -object_id $parent_id
+ permission::toggle_inherit -object_id $items_parent_id
+
+ # Set read permissions for community/class dotlrn_member_rel
+
+ permission::grant \
+ -party_id $party_id_member \
+ -object_id $parent_id \
+ -privilege read
+
+ permission::grant \
+ -party_id $party_id_member \
+ -object_id $items_parent_id \
+ -privilege read
+
+ # Set read permissions for community/class dotlrn_admin_rel
+
+ permission::grant \
+ -party_id $party_id_admin \
+ -object_id $parent_id \
+ -privilege read
+
+ permission::grant \
+ -party_id $party_id_admin \
+ -object_id $items_parent_id \
+ -privilege read
+
+ # Set read permissions for *all* other professors within .LRN
+ # (so they can see the content)
+
+
+ permission::grant \
+ -party_id $party_id_professor \
+ -object_id $parent_id \
+ -privilege read
+
+ permission::grant \
+ -party_id $party_id_professor \
+ -object_id $items_parent_id \
+ -privilege read
+
+ # Set read permissions for *all* other admins within .LRN
+ # (so they can see the content)
+
+
+ permission::grant \
+ -party_id $party_id_admins \
+ -object_id $parent_id \
+ -privilege read
+
+ permission::grant \
+ -party_id $party_id_admins \
+ -object_id $items_parent_id \
+ -privilege read
+
+ # 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
+
+ permission::grant \
+ -party_id $party_id_member \
+ -object_id $man_id \
+ -privilege read
+
+ # Set read permissions for community/class dotlrn_admin_rel
+
+ 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)
+
+ 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)
+
+ permission::grant \
+ -party_id $party_id_admins \
+ -object_id $man_id \
+ -privilege read
+
+ # Done with Manifest and learning object Permissions
+}
+
Index: openacs-4/packages/dotlrn-lorsm/tcl/dotlrn-lorsm-callback-procs.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-lorsm/tcl/dotlrn-lorsm-callback-procs.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-lorsm/tcl/dotlrn-lorsm-callback-procs.xql 16 Feb 2009 00:24:54 -0000 1.1
@@ -0,0 +1,38 @@
+
+
+
+
+
+ select segment_id
+ from rel_segments
+ where group_id = :community_id
+ and rel_type = 'dotlrn_member_rel'
+
+
+
+
+
+ select segment_id
+ from rel_segments
+ where group_id = :community_id
+ and rel_type = 'dotlrn_admin_rel'
+
+
+
+
+
+ select segment_id
+ from rel_segments
+ where rel_type = 'dotlrn_professor_profile_rel'
+
+
+
+
+
+ select segment_id
+ from rel_segments
+ where rel_type = 'dotlrn_admin_profile_rel'
+
+
+
+
Index: openacs-4/packages/lorsm/lorsm.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/lorsm.info,v
diff -u -r1.21 -r1.22
--- openacs-4/packages/lorsm/lorsm.info 9 Feb 2009 03:57:30 -0000 1.21
+++ openacs-4/packages/lorsm/lorsm.info 16 Feb 2009 00:24:54 -0000 1.22
@@ -7,13 +7,13 @@
f
f
-
+
Ernie Ghiglione
Application to manage the services from the Learning Object Repository.
2008-10-17
This application manages the services from the Learning Object Repository: upload courses, manage and create metadata, delete resources and courses.
-
+
Index: openacs-4/packages/lorsm/tcl/lorsm-callback-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/tcl/lorsm-callback-procs.tcl,v
diff -u -r1.6 -r1.7
--- openacs-4/packages/lorsm/tcl/lorsm-callback-procs.tcl 15 Feb 2009 01:46:46 -0000 1.6
+++ openacs-4/packages/lorsm/tcl/lorsm-callback-procs.tcl 16 Feb 2009 00:24:54 -0000 1.7
@@ -58,3 +58,17 @@
-community_id $community_id]
}
}
+
+ad_proc -public -callback lorsm::permissions_kludge {
+ -community_id
+ -parent_id
+ -items_parent_id
+ -man_id
+} {
+ @author Don Baccus
+
+ Allows a package using lorsm to kludge permissions to whatever warped view of the
+ world it supports. The first implementation provided is for dotlrn, need more be
+ said?
+} -
+
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
}
Index: openacs-4/packages/lorsm/tcl/lorsm-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/tcl/lorsm-procs.tcl,v
diff -u -r1.23 -r1.24
--- openacs-4/packages/lorsm/tcl/lorsm-procs.tcl 14 Feb 2009 22:33:20 -0000 1.23
+++ openacs-4/packages/lorsm/tcl/lorsm-procs.tcl 16 Feb 2009 00:24:54 -0000 1.24
@@ -639,7 +639,10 @@
ad_conn -set package_id [lors::get_community_package_id $community_id]
- set object_id [lorsm::import_imscp -upload_file $xml_file -tmp_dir $tmp_dir]
+ set object_id [lorsm::import_imscp \
+ -community_id $community_id \
+ -upload_file $xml_file \
+ -tmp_dir $tmp_dir]
# Restore the package_id
ad_conn -set package_id $current_package_id
Index: openacs-4/packages/lorsm/www/admin/course-add-3.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/course-add-3.tcl,v
diff -u -r1.12 -r1.13
--- openacs-4/packages/lorsm/www/admin/course-add-3.tcl 14 Feb 2009 22:32:19 -0000 1.12
+++ openacs-4/packages/lorsm/www/admin/course-add-3.tcl 16 Feb 2009 00:24:54 -0000 1.13
@@ -31,6 +31,7 @@
}
set context ""
+set community_id [lors::get_community_id]
#check permission
set user_id [ad_conn user_id]
@@ -107,72 +108,6 @@
-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_admins {}]
-
- 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 \
@@ -353,57 +288,6 @@
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_admins {}]
-
- 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]
"
if {$man_hasmetadata == 1} {
@@ -649,4 +533,10 @@
# jump to the front page
ad_progress_bar_end -url [apm_package_url_from_id [ad_conn package_id]]/admin
+
+ callback lorsm::permissions_kludge \
+ -community_id $community_id \
+ -parent_id $new_parent_id \
+ -items_parent_id $new_items_parent_id \
+ -man_id $man_id
}
Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/packages/lorsm/www/admin/course-add-3.xql'.
Fisheye: No comparison available. Pass `N' to diff?
Index: openacs-4/packages/lorsm-portlet/lorsm-portlet.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm-portlet/lorsm-portlet.info,v
diff -u -r1.11 -r1.12
--- openacs-4/packages/lorsm-portlet/lorsm-portlet.info 9 Nov 2008 23:29:27 -0000 1.11
+++ openacs-4/packages/lorsm-portlet/lorsm-portlet.info 16 Feb 2009 00:24:54 -0000 1.12
@@ -7,13 +7,13 @@
f
t
-
+
Ernie Ghiglione
2008-10-18
OpenACS
-
-
+
+