Index: openacs-4/packages/calendar/tcl/calendar-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/tcl/calendar-procs.tcl,v diff -u -r1.39.2.15 -r1.39.2.16 --- openacs-4/packages/calendar/tcl/calendar-procs.tcl 15 Feb 2023 14:19:30 -0000 1.39.2.15 +++ openacs-4/packages/calendar/tcl/calendar-procs.tcl 15 Feb 2023 15:20:45 -0000 1.39.2.16 @@ -120,7 +120,7 @@ } -ad_proc -public calendar::assign_permissions { +ad_proc -deprecated calendar::assign_permissions { calendar_id party_id cal_privilege @@ -133,6 +133,11 @@ If the revoke is set, then the given permission will be removed for the party. + + DEPRECATED: this api is a trivial wrapper to the permission api + + @see permission::grant + @see permission::revoke } { # Default privilege is being able to read. Index: openacs-4/packages/calendar/tcl/test/cal-item-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/tcl/test/cal-item-procs.tcl,v diff -u -r1.8.2.11 -r1.8.2.12 --- openacs-4/packages/calendar/tcl/test/cal-item-procs.tcl 15 Feb 2023 14:52:49 -0000 1.8.2.11 +++ openacs-4/packages/calendar/tcl/test/cal-item-procs.tcl 15 Feb 2023 15:20:45 -0000 1.8.2.12 @@ -166,7 +166,6 @@ calendar::item::delete calendar::item::get calendar::item::new - calendar::assign_permissions calendar::calendar_list calendar::do_notifications calendar::notification::get_url @@ -207,7 +206,8 @@ [permission::permission_p -party_id [acs_magic_object "the_public"] -object_id $calendar_id -privilege calendar_read] aa_log "Assign permission on user" - calendar::assign_permissions $calendar_id $another_user private + permission::grant -object_id $calendar_id -party_id $another_user -privilege calendar_read + aa_true "User '$another_user' has 'calendar_read' permission on calendar '$calendar_id'" \ [permission::permission_p -party_id $another_user -object_id $calendar_id -privilege calendar_read] aa_false "The public has no 'calendar_read' permission on calendar '$calendar_id'" \ @@ -274,22 +274,23 @@ aa_log "Create a public test calendar belonging to the current user" set calendar_id_3 [calendar::create $user_id f] - calendar::assign_permissions $calendar_id_3 $another_user private + permission::grant -object_id $calendar_id_3 -party_id $another_user -privilege calendar_read aa_true "User '$another_user' has the new calendar" { [string first \ $calendar_id_3 \ [calendar::calendar_list -user_id $another_user -privilege calendar_read]] >= 0 } aa_log "Revoking permission on user" - calendar::assign_permissions $calendar_id $another_user private revoke + permission::revoke -object_id $calendar_id_3 -party_id $another_user -privilege calendar_read + aa_false "User '$another_user' has no 'calendar_read' permission on calendar '$calendar_id'" \ [permission::permission_p -party_id $another_user -object_id $calendar_id -privilege calendar_read] aa_false "The public has no 'calendar_read' permission on calendar '$calendar_id'" \ [permission::permission_p -party_id [acs_magic_object "the_public"] -object_id $calendar_id -privilege calendar_read] aa_log "Assign permission to the public" - calendar::assign_permissions $calendar_id "" public + permission::grant -object_id $calendar_id -party_id [acs_magic_object "the_public"] -privilege $cal_privilege set cache_p [parameter::get -package_id [ad_acs_kernel_id] -parameter PermissionCacheP -default 0] if { $cache_p } { Index: openacs-4/packages/calendar/www/admin/calendar-create.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/admin/calendar-create.tcl,v diff -u -r1.5 -r1.5.2.1 --- openacs-4/packages/calendar/www/admin/calendar-create.tcl 30 Jun 2018 22:04:28 -0000 1.5 +++ openacs-4/packages/calendar/www/admin/calendar-create.tcl 15 Feb 2023 15:20:45 -0000 1.5.2.1 @@ -36,7 +36,11 @@ if {$calendar_permission eq "public"} { # assign the permission to the calendar - calendar::assign_permissions $calendar_id $party_id $calendar_permission + ::permission::grant \ + -object_id $calendar_id \ + -party_id [acs_magic_object "the_public"] \ + -privilege calendar_read + ad_returnredirect "one?action=permission&calendar_id=$calendar_id" } elseif {$calendar_permission eq "private"} {