示例#1
0
    def has_perm(self, user_obj, perm, obj=None):
        if user_obj.is_anonymous():
            return False

        if registry.has_privilege(user_obj, perm):
            return True

        return super(PrivilegesBackend, self).has_perm(user_obj, perm)
示例#2
0
 def has_perm(self, user_obj, perm, obj=None):
     if user_obj.is_anonymous():
         return False
     
     if registry.has_privilege(user_obj, perm):
         return True
     
     return super(PrivilegesBackend, self).has_perm(user_obj, perm)
示例#3
0
 def render(self, context):
     privilege = self.privilege.resolve(context)
     user = self.user.resolve(context)
     context[self.varname] = registry.has_privilege(user, privilege)
     return ""
示例#4
0
 def render(self, context):
     privilege = self.privilege.resolve(context)
     user = self.user.resolve(context)
     context[self.varname] = registry.has_privilege(user, privilege)
     return ""