give admin user "admin" capability
This commit is contained in:
parent
e955927644
commit
21411694e8
1 changed files with 8 additions and 4 deletions
|
@ -128,12 +128,16 @@ class User(UserBase):
|
|||
self,
|
||||
db: Session,
|
||||
capabilities: list[UserCapability],
|
||||
) -> bool:
|
||||
) -> None:
|
||||
for capability in capabilities:
|
||||
# TODO
|
||||
pass
|
||||
if capability not in self.capabilities:
|
||||
cap = models.UserCapability(
|
||||
user_name=self.name,
|
||||
capability=capability.value,
|
||||
)
|
||||
db.add(cap)
|
||||
|
||||
return True
|
||||
db.commit()
|
||||
|
||||
|
||||
class DistinguishedNameBase(BaseModel):
|
||||
|
|
Loading…
Reference in a new issue