Ejemplo n.º 1
0
 def _getRules(self, settings, fromcache=True):
     if fromcache:
         key = "%s:%s" % getHost(self.request)
         if key in _rule_cache:
             rules = _rule_cache[key]
         else:
             rules = convertRules(settings.rules)
             _rule_cache[key] = rules
         return rules
     else:
         return convertRules(settings.rules)
Ejemplo n.º 2
0
    def getRules(self, settings):
        fromcache = True
        if settings.development_mode:
            fromcache = False
        elif "b.reload" in self.request:
            key = "%s:%s" % getHost(self.request)
            if key in _rule_cache:
                portal = getSite()
                membership = getToolByName(portal, "portal_membership")
                if membership.checkPermission("Manage portal", portal):
                    del _rule_cache[key]

        return self._getRules(settings, fromcache)