Skip to content

Commit

Permalink
[azure][fix]: Fix connect_in_graph method of `AzureAuthorizationRol…
Browse files Browse the repository at this point in the history
…eAssignment` resource (#2215)
  • Loading branch information
1101-1 authored Sep 30, 2024
1 parent 0dd8f24 commit a5267a3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugins/azure/fix_plugin_azure/resource/authorization.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class AzureAuthorizationRoleAssignment(MicrosoftResource):
"Group": MicrosoftGraphGroup.kind,
"Subscription": "azure_subscription",
"ResourceGroup": "azure_resource_group",
"Resource": "azure_resource",
"Resource": "microsoft_resource",
}
_reference_kinds: ClassVar[ModelReference] = {
"successors": {
Expand All @@ -146,7 +146,7 @@ class AzureAuthorizationRoleAssignment(MicrosoftResource):
"azure_authorization_role_definition",
"azure_subscription",
"azure_resource_group",
"azure_resource",
"microsoft_resource",
]
},
}
Expand Down Expand Up @@ -193,7 +193,7 @@ def connect_in_graph(self, builder: GraphBuilder, source: Json) -> None:
scope_parts = scope.split("/")
if scope.startswith("/providers/Microsoft.Management/managementGroups/"): # management group
pass
elif len(scope_parts) == 2: # subscription
elif len(scope_parts) == 3: # subscription
builder.add_edge(self, reverse=True, clazz=AzureSubscription, id=scope_parts[-1])
else: # resource group or resource
builder.add_edge(self, reverse=True, id=scope)
Expand Down

0 comments on commit a5267a3

Please sign in to comment.