Skip to content

Commit

Permalink
prevent returning resource_instance on local role assignments for top…
Browse files Browse the repository at this point in the history
… level roles
  • Loading branch information
omer9564 committed Jan 6, 2025
1 parent 6f68e53 commit eb0f7f7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions horizon/local/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,11 @@ def tenant(self) -> str:
return self.attributes.get("tenant", "")

@property
def resource_instance(self) -> str:
return self.attributes.get("resource", "")
def resource_instance(self) -> str | None:
resource = self.attributes.get("resource", "")
if not resource or resource.startswith("__tenant:"):
return None
return resource

def into_role_assignment(self) -> RoleAssignment:
return RoleAssignment(
Expand Down

0 comments on commit eb0f7f7

Please sign in to comment.