diff --git a/api/kiwi_vpn_api/db/schemas.py b/api/kiwi_vpn_api/db/schemas.py index 0e52185..709bb01 100644 --- a/api/kiwi_vpn_api/db/schemas.py +++ b/api/kiwi_vpn_api/db/schemas.py @@ -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):