Index: openacs-4/packages/lors-central/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/index.tcl,v diff -u -r1.1 -r1.1.2.1 --- openacs-4/packages/lors-central/www/index.tcl 17 May 2005 16:21:19 -0000 1.1 +++ openacs-4/packages/lors-central/www/index.tcl 13 Jun 2005 15:10:42 -0000 1.1.2.1 @@ -8,9 +8,12 @@ keyword:optional } -# Checking swa privilege over lors-central -lors_central::is_swa +set user_id [ad_conn user_id] + +# Checking privilege over lors-central +lors_central::check_permissions + set title "[_ lorsm.lt_Manage_Courses_in_Rep]" set context [list "[_ lorsm.Manage_Courses]"] @@ -32,6 +35,11 @@ set extra_query "" } +# If user is not site wide we just show the courses where he/she has admin privilege over +if { ![acs_user::site_wide_admin_p] } { + append extra_query " and p.object_id = acs.object_id and p.privilege = 'admin' and p.grantee_id = :user_id" +} + set package_id [ad_conn package_id] set user_id [ad_conn user_id] set community_id [dotlrn_community::get_community_id] @@ -49,10 +57,11 @@ set actions [list] -lappend actions "[_ lorsm.Add_Course]" [export_vars -base "course-add"] "[_ lorsm.lt_Add_a_IMSSCORM_Compli]" -lappend actions "[_ lorsm.lt_Search_Learning_Objec]" [export_vars -base "search"] "[_ lorsm.lt_Search_for_Learninng_]" +if { [lors_central::check_inst -user_id $user_id] } { + lappend actions "[_ lorsm.Add_Course]" [export_vars -base "course-add"] "[_ lorsm.lt_Add_a_IMSSCORM_Compli]" + lappend actions "[_ lorsm.lt_Search_Learning_Objec]" [export_vars -base "search"] "[_ lorsm.lt_Search_for_Learninng_]" +} - template::list::create \ -name get_courses \ -multirow get_courses \