forked from devs/PCv5
privs: fixed #127
This commit is contained in:
parent
0865ae0e67
commit
c31cca6314
|
@ -212,7 +212,7 @@ class Member(User):
|
|||
|
||||
def priv(self, priv):
|
||||
"""Check whether the member has the specified privilege."""
|
||||
if priv in self.special_privs:
|
||||
if priv in self.special_privileges():
|
||||
return True
|
||||
for g in self.groups:
|
||||
if priv in g.privs():
|
||||
|
@ -220,8 +220,8 @@ class Member(User):
|
|||
return False
|
||||
|
||||
def special_privileges(self):
|
||||
"""List member's special privileges."""
|
||||
return sorted(self.special_privs, key=lambda x: x.priv)
|
||||
"""List member's special privileges as list of strings."""
|
||||
return sorted([p.priv for p in self.special_privs])
|
||||
|
||||
def can_access_forum(self, forum):
|
||||
"""Whether this member can read the forum's contents."""
|
||||
|
|
Loading…
Reference in New Issue