From ad9fc47766ed1cfacc4a9aab433043c5cab93d45 Mon Sep 17 00:00:00 2001 From: Guillaume Mazoyer Date: Mon, 18 Nov 2024 21:33:34 +0100 Subject: [PATCH] Remove duplicate return --- backend/infrahub/permissions/report.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/backend/infrahub/permissions/report.py b/backend/infrahub/permissions/report.py index 7bbdb9820e..919b295a4c 100644 --- a/backend/infrahub/permissions/report.py +++ b/backend/infrahub/permissions/report.py @@ -29,8 +29,6 @@ def get_permission_report( # noqa: PLR0911 if global_permission_report[GlobalPermissions.SUPER_ADMIN]: return BranchRelativePermissionDecision.ALLOW - is_default_branch = branch.name in (GLOBAL_BRANCH_NAME, registry.default_branch) - if action != "view": if node.kind in (InfrahubKind.ACCOUNTGROUP, InfrahubKind.ACCOUNTROLE, InfrahubKind.GENERICACCOUNT) or ( isinstance(node, NodeSchema) and InfrahubKind.GENERICACCOUNT in node.inherit_from @@ -57,9 +55,7 @@ def get_permission_report( # noqa: PLR0911 else BranchRelativePermissionDecision.DENY ) - if global_permission_report[GlobalPermissions.SUPER_ADMIN]: - return BranchRelativePermissionDecision.ALLOW - + is_default_branch = branch.name in (GLOBAL_BRANCH_NAME, registry.default_branch) decision = backend.report_object_permission( permissions=permissions["object_permissions"], namespace=node.namespace, name=node.name, action=action )