privs: fixed #127

This commit is contained in:
Darks 2023-06-06 23:07:14 +02:00
parent 0865ae0e67
commit c31cca6314
Signed by: Darks
GPG Key ID: 7515644268BE1433
1 changed files with 3 additions and 3 deletions

View File

@ -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."""