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,
|
self,
|
||||||
db: Session,
|
db: Session,
|
||||||
capabilities: list[UserCapability],
|
capabilities: list[UserCapability],
|
||||||
) -> bool:
|
) -> None:
|
||||||
for capability in capabilities:
|
for capability in capabilities:
|
||||||
# TODO
|
if capability not in self.capabilities:
|
||||||
pass
|
cap = models.UserCapability(
|
||||||
|
user_name=self.name,
|
||||||
|
capability=capability.value,
|
||||||
|
)
|
||||||
|
db.add(cap)
|
||||||
|
|
||||||
return True
|
db.commit()
|
||||||
|
|
||||||
|
|
||||||
class DistinguishedNameBase(BaseModel):
|
class DistinguishedNameBase(BaseModel):
|
||||||
|
|
Loading…
Reference in a new issue