feat(auth-models): Add is_admin field to User model
This commit adds an is_admin field to the User model definition in user.py. It is set to False by default and has been updated in fake_users_db for both users. Also, there were some code formatting changes made in auth.py.
This commit is contained in:
parent
6d78aefa62
commit
f855433652
2 changed files with 5 additions and 2 deletions
|
|
@ -6,6 +6,7 @@ class User(BaseModel):
|
||||||
email: str | None = None
|
email: str | None = None
|
||||||
full_name: str | None = None
|
full_name: str | None = None
|
||||||
disabled: bool | None = None
|
disabled: bool | None = None
|
||||||
|
is_admin: bool | None = False
|
||||||
|
|
||||||
|
|
||||||
class UserInDB(User):
|
class UserInDB(User):
|
||||||
|
|
@ -19,6 +20,7 @@ fake_users_db = {
|
||||||
"email": "gustavopoa@gmail.com",
|
"email": "gustavopoa@gmail.com",
|
||||||
"hashed_password": "$2b$12$f4R8IHUaVxVchhpWrwhckeJXnPalW1vUbJzcvb1KeovJcuMwE861K", #secret
|
"hashed_password": "$2b$12$f4R8IHUaVxVchhpWrwhckeJXnPalW1vUbJzcvb1KeovJcuMwE861K", #secret
|
||||||
"disabled": False,
|
"disabled": False,
|
||||||
|
"is_admin": True,
|
||||||
},
|
},
|
||||||
"gustavo_disabled": {
|
"gustavo_disabled": {
|
||||||
"username": "gustavo_disabled",
|
"username": "gustavo_disabled",
|
||||||
|
|
@ -26,6 +28,7 @@ fake_users_db = {
|
||||||
"email": "gustavo_disabled@gmail.com",
|
"email": "gustavo_disabled@gmail.com",
|
||||||
"hashed_password": "$2b$12$f4R8IHUaVxVchhpWrwhckeJXnPalW1vUbJzcvb1KeovJcuMwE861K", #secret
|
"hashed_password": "$2b$12$f4R8IHUaVxVchhpWrwhckeJXnPalW1vUbJzcvb1KeovJcuMwE861K", #secret
|
||||||
"disabled": True,
|
"disabled": True,
|
||||||
|
"is_admin": False,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue