chore: adapt to SQLModel 16 & SQLAlchemy 2.x

This commit is contained in:
swve 2024-04-01 12:20:29 +02:00
parent 938c3a2349
commit c8f6aff996
24 changed files with 120 additions and 123 deletions

View file

@ -103,7 +103,7 @@ async def authorization_verify_based_on_roles(
# Find in roles list if there is a role that matches users action for this type of element
for role in user_roles_in_organization_and_standard_roles:
role = Role.from_orm(role)
role = Role.model_validate(role)
if role.rights:
rights = role.rights
if rights[element_type][f"action_{action}"] is True:
@ -135,7 +135,7 @@ async def authorization_verify_based_on_org_admin_status(
# Find in roles list if there is a role that matches users action for this type of element
for role in user_roles_in_organization_and_standard_roles:
role = Role.from_orm(role)
role = Role.model_validate(role)
if role.id == 1 or role.id == 2:
return True
else: