Skip to content

Commit

Permalink
Remove duplicate return
Browse files Browse the repository at this point in the history
  • Loading branch information
gmazoyer committed Nov 18, 2024
1 parent 8429d64 commit ad9fc47
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions backend/infrahub/permissions/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
)
Expand Down

0 comments on commit ad9fc47

Please sign in to comment.