def has_permission(permission, context, request):

    """ Cache permission in request """

    key = 'permission_%s_%s' % (permission, context.dottedpath)

    if not key in request.environ:
        request.environ[key] = base_has_permission(permission, context, request)
        
    return request.environ[key]
Exemple #2
0
 def has_permission(self, perm_name, context=None):
     context = context or self.context
     return base_has_permission(perm_name, context, self.request)
Exemple #3
0
def has_permission(permission, context, request):
    with authz_context(context, request):
        return base_has_permission(permission, context, request)
 def has_permission(self, perm_name, context=None):
     context = context or self.context
     return base_has_permission(perm_name, context, self.request)
Exemple #5
0
def has_permission(permission, context, request):
    with authz_context(context, request):
        return base_has_permission(permission, context, request)