Ejemplo n.º 1
0
def has_perms(user: User, required_privilege: UserType):
    return user.has_perm(required_privilege)
Ejemplo n.º 2
0
def has_perms(user: User, required_privilege: UserType):
    """
    Returns True if the user has the specified permission,
    where perm is in the format "<app label>.<permission codename>"
    """
    return user.has_perm(required_privilege)
Ejemplo n.º 3
0
def has_perm(user: User, required_privilege: UserType):
    return user.has_perm(UserType[required_privilege])