Index: openacs-4/packages/acs-tcl/tcl/acs-permissions-init.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/acs-permissions-init.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-tcl/tcl/acs-permissions-init.tcl 27 Jun 2018 08:15:29 -0000 1.2 +++ openacs-4/packages/acs-tcl/tcl/acs-permissions-init.tcl 14 Oct 2018 18:38:14 -0000 1.3 @@ -1,17 +1,14 @@ -if {[info commands ns_cache_eval] ne ""} { - # - # Permission cache management for NaviServer. - # - # Some of this code will go away, when abstract cache management - # will be introduced. - # - if {![info exists ::permission::cache_created]} { - ns_log notice "acs-tcl: creating permission cache" - ns_cache_create \ - -expires [parameter::get -package_id [ad_acs_kernel_id] \ - -parameter PermissionCacheTimeout \ - -default 300] \ - permission_cache 100000 - set permission::cache_created 1 - } -} +# +# Create permission caches. The sizes can be tailored in the config + # file like the following: +# +# ns_section ns/server/${server}/acs/acs-tcl +# ns_param PermissionCacheSize 100000 +# ns_param PermissionCachePartitions 2 +# +::acs::KeyPartitionedCache create ::acs::permission_cache \ + -package_key acs-tcl \ + -parameter PermissionCache \ + -default_size 100000 \ + -partitions 2 + Index: openacs-4/packages/acs-tcl/tcl/acs-permissions-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/acs-permissions-procs.tcl,v diff -u -r1.46 -r1.47 --- openacs-4/packages/acs-tcl/tcl/acs-permissions-procs.tcl 25 Jul 2018 20:18:48 -0000 1.46 +++ openacs-4/packages/acs-tcl/tcl/acs-permissions-procs.tcl 14 Oct 2018 18:38:14 -0000 1.47 @@ -329,12 +329,14 @@ @see permission::permission_p } { - return [ns_cache eval permission_cache $party_id/$object_id/$privilege { - permission::permission_p_not_cached \ - -party_id $party_id \ - -object_id $object_id \ - -privilege $privilege - }] + return [acs::permission_cache eval \ + -partition_key $party_id \ + $party_id/$object_id/$privilege { + permission::permission_p_not_cached \ + -party_id $party_id \ + -object_id $object_id \ + -privilege $privilege + }] } # @@ -356,20 +358,20 @@ @see permission::permission_p } { - if {![info exists ::permission::cache_created]} { + if {[info commands ::acs::permission_cache] eq ""} { return } elseif {[info exists party_id] && [info exists object_id] && [info exists privilege]} { # # All three attributes are provided # - ns_cache_flush permission_cache $party_id/$object_id/$privilege + ::acs::permission_cache flush -partition_key $party_id $party_id/$object_id/$privilege } elseif {[info exists party_id] } { # # At least the party_id is provided # - ns_cache_flush -glob permission_cache $party_id/* + ::acs::permission_cache flush_all -partition_key $party_id } else { # # tell user, what's implemented @@ -426,7 +428,7 @@ @see permission::permission_p } { - if {![info exists ::permission::cache_created]} { + if {[info command ::acs::permission_cache] eq ""} { return } elseif {[info exists party_id] && [info exists object_id] && [info exists privilege]} {