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]
def has_permission(self, perm_name, context=None): context = context or self.context return base_has_permission(perm_name, context, self.request)
def has_permission(permission, context, request): with authz_context(context, request): return base_has_permission(permission, context, request)