add all suppress modal
All checks were successful
Deploy Amap / deploy (push) Successful in 41s

This commit is contained in:
Julien Aldon
2026-03-06 16:48:38 +01:00
parent 74bf1474e2
commit 46b369ecd9
39 changed files with 654 additions and 372 deletions

View File

@@ -93,6 +93,7 @@ def delete_one(
session.commit()
return result
def is_allowed(
session: Session,
user: models.User,
@@ -103,12 +104,8 @@ def is_allowed(
return False
if not _id:
statement = (
select(models.Product)
.join(
models.Productor,
models.Product.productor_id == models.Productor.id
)
.where(models.Product.id == product.productor_id)
select(models.Productor)
.where(models.Productor.id == product.productor_id)
)
productor = session.exec(statement).first()
return productor.type in [r.name for r in user.roles]