check if user can do
This commit is contained in:
parent
22e1ef7bf4
commit
d41cd9b15b
1 changed files with 3 additions and 0 deletions
|
@ -109,6 +109,9 @@ class User(UserBase, table=True):
|
||||||
db.delete(self)
|
db.delete(self)
|
||||||
db.commit()
|
db.commit()
|
||||||
|
|
||||||
|
def can(self, capability: Capability) -> bool:
|
||||||
|
return capability in self.get_capabilities()
|
||||||
|
|
||||||
def get_capabilities(self) -> set[Capability]:
|
def get_capabilities(self) -> set[Capability]:
|
||||||
return set(
|
return set(
|
||||||
capability._
|
capability._
|
||||||
|
|
Loading…
Reference in a new issue