示例#1
0
文件: User.py 项目: keat01/pyLoad
    def hasPermission(self, perms):
        """  Accepts permission bit or name  """

        if isinstance(perms, basestring) and hasattr(Permission, perms):
            perms = getattr(Role, perms)

        return has_permission(self.permission, perms)
示例#2
0
    def hasPermission(self, perms):
        """  Accepts permission bit or name  """

        if isinstance(perms, basestring) and hasattr(Permission, perms):
            perms = getattr(Role, perms)

        return has_permission(self.permission, perms)
示例#3
0
文件: utils.py 项目: vuolter/pyreload
def get_permission(perms, p):
    """Returns a dict with permission key

    :param perms: dictionary
    :param p:  bits
    """
    for name in permlist():
        perms[name] = has_permission(p, getattr(PERMS, name))
示例#4
0
文件: utils.py 项目: 3DMeny/pyload
def get_permission(perms, p):
    """Returns a dict with permission key

    :param perms: dictionary
    :param p:  bits
    """
    for name in permlist():
        perms[name] = has_permission(p, getattr(PERMS, name))