From b2cffdb62c1d978e28b474cd2ad1674432776d62 Mon Sep 17 00:00:00 2001 From: Guillaume Mazoyer Date: Mon, 25 Nov 2024 11:17:12 +0100 Subject: [PATCH] Restore error message for branch perm --- backend/infrahub/api/schema.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/infrahub/api/schema.py b/backend/infrahub/api/schema.py index 76d56bdb42..8802af4d23 100644 --- a/backend/infrahub/api/schema.py +++ b/backend/infrahub/api/schema.py @@ -275,8 +275,10 @@ async def load_schema( if has_permission and has_branch_permission: break - if not has_permission or not has_branch_permission: + if not has_permission: raise PermissionDeniedError("You are not allowed to manage the schema") + if not has_branch_permission: + raise PermissionDeniedError("You are not allowed to edit the schema in the default branch") service: InfrahubServices = request.app.state.service log.info("schema_load_request", branch=branch.name)