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.1 -r1.2 --- openacs-4/packages/acs-tcl/tcl/acs-permissions-init.tcl 23 Jun 2018 17:49:22 -0000 1.1 +++ openacs-4/packages/acs-tcl/tcl/acs-permissions-init.tcl 27 Jun 2018 08:15:29 -0000 1.2 @@ -5,16 +5,13 @@ # Some of this code will go away, when abstract cache management # will be introduced. # - try { - ns_cache_flush permission_cache NOTHING - } on error {errorMsg} { - if {[info commands ad_acs_kernel_id] ne ""} { - 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 - } + 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 } } 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.43 -r1.44 --- openacs-4/packages/acs-tcl/tcl/acs-permissions-procs.tcl 26 Jun 2018 12:46:47 -0000 1.43 +++ openacs-4/packages/acs-tcl/tcl/acs-permissions-procs.tcl 27 Jun 2018 08:15:29 -0000 1.44 @@ -356,12 +356,10 @@ @see permission::permission_p } { - # cache is not enabled, exit immediately - if {[catch {ns_cache_flush permission_cache NOTHING}]} { + if {![info exists ::permission::cache_created]} { return - } - - if {[info exists party_id] && [info exists object_id] && [info exists privilege]} { + + } elseif {[info exists party_id] && [info exists object_id] && [info exists privilege]} { # # All three attributes are provided # @@ -428,13 +426,16 @@ @see permission::permission_p } { - if {[info exists party_id] && [info exists object_id] && [info exists privilege]} { + if {![info exists ::permission::cache_created]} { + return + + } elseif {[info exists party_id] && [info exists object_id] && [info exists privilege]} { # # All three attributes are provided # util_memoize_flush [list permission::permission_p_not_cached -party_id $party_id -object_id $object_id -privilege $privilege] - } else {[info exists party_id] } { + } elseif {[info exists party_id] } { # # At least the party_id is provided #