Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot group by resource group if I have access to a resource but not its resource group #831

Open
vsantele opened this issue Mar 18, 2024 · 3 comments
Labels
enhancement New feature or request
Milestone

Comments

@vsantele
Copy link

Hi, I have a "tricky" case that is not well handled by the extension.

In a subscription, I have access to an App Service but not its resource group. So, when I tried to group by resource group, I got the following error:

Internal error: Expected value to be neither null nor undefined: resourceGroup for grouping item

The error is thrown by this line (src/tree/azure/grouping/AzureResourceGroupingManager.ts#164)

It is possible to display the resource group even if we don't have access to it? We will not be able to do action on it, of course.

@vsantele vsantele changed the title Canno group by resource group if I have access to a resource but not its resource group Cannot group by resource group if I have access to a resource but not its resource group Mar 18, 2024
@nturinski
Copy link
Member

Hi @vsantele

It is possible to display the resource group even if we don't have access to it? We will not be able to do action on it, of course.

I just want to clarify, but the scenario is that you want the resource group to still be displayed? Not the resource that's in the resource group?

@vsantele
Copy link
Author

Hi @nturinski,

It's more the opposite way. I don't have access to the resource group, only to one resource in it, but I still want to group all my available resources by resource group.

At the moment, if I want to group by resource group, I get an error because the AzureResource of the related resource group of my service app is not in the array allResources passed in groupByResourceGroup

But we can find the name of this resource group. So why not have this RG displayed in the list and not only RG where I got right on it?

Here is a schema to be clear:

- MyRG1 <- I have access
-- MyCosmosDB <- I Have access 
- MyRG2 <- I don't have access
-- MyAppService <- I have access

I cannot group my resources by resource group because of MyRG2.

One way of solving this is to display only a "visual RG" when a user doesn't have access to the parent RG of a resource. This way, we can always group by RG. A "visual RG" will not have all the options inside its context menu like other RG (delete, edit tags, etc)
But, GroupingItemFactory.createResourceGroupGroupingItem requires an AzureResource, so I don't think it's possible to do this without further exploration.

@alexweininger
Copy link
Member

One way of solving this is to display only a "visual RG" when a user doesn't have access to the parent RG of a resource. This way, we can always group by RG. A "visual RG" will not have all the options inside its context menu like other RG (delete, edit tags, etc)

I agree with the proposed solution.

@alexweininger alexweininger added feature enhancement New feature or request and removed feature labels Apr 3, 2024
@alexweininger alexweininger added this to the 0.7.0 milestone Apr 3, 2024
@MicroFish91 MicroFish91 modified the milestones: 0.7.0, 0.10.0 Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants