cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bouillons
Resolver I
Resolver I

Using Office365Groups.ListGroupMembers with nested groups

I'm inspecting group membership to control view/edit access to parts of my App using the Office365Groups connector.

 

I'm using the following instruction to check if a user is a Telecom Manager:

Set(gTelecomManager,!IsEmpty(Filter(Office365Groups.ListGroupMembers(gTelecomManagersGroup).value,mail=User().Email)));

 

This works fine if the group contains individual users, but when I add another security group to the TelecomManagers Group instead of using individual members, the  instruction returns false, even if the user is part of (one of) the member group(s) of the Telecom Managers group. I could go recursively through the group(s) and check deeper and deeper until I get to the individual user level, but this will quickly get wieldy and probably slow. What would be the recommended way to make this work ?

 

Stephane

 

1 ACCEPTED SOLUTION

Accepted Solutions
bouillons
Resolver I
Resolver I

Hi, based on Solved: Office365Groups Connector to security group - Power Platform Community (microsoft.com), I used another connector. the AzureAD connector has more capabilities and it takes nested group membership into account.

 

Set(gTelecomManagersGroup,"12db ... ID of the Group ... 8ca6");
Set(gTelecomManager,!IsEmpty(Filter(AzureAD.GetMemberGroupsV2(User().Email, true).value, Value=gTelecomManagersGroup)));

 Stephane

View solution in original post

3 REPLIES 3
bouillons
Resolver I
Resolver I

I tried the other way around, by using the ListOwnedGroupsV3 to see if the group I need to be part of to edit/view something in the App returns any rows.

 

Filter(Office365Groups.ListOwnedGroupsV3().value,StartsWith(displayName,"SG_TelecomManagers"))

 

Unfortunately this method only returns Office365 groups, and not AD security groups. Even if I base my security on Office365 groups instead of AD Security groups, I'm still stuck as I will have to add individuals instead of groups as members of the TelecomManagers group.

 

Stephane

bouillons
Resolver I
Resolver I

Hi, based on Solved: Office365Groups Connector to security group - Power Platform Community (microsoft.com), I used another connector. the AzureAD connector has more capabilities and it takes nested group membership into account.

 

Set(gTelecomManagersGroup,"12db ... ID of the Group ... 8ca6");
Set(gTelecomManager,!IsEmpty(Filter(AzureAD.GetMemberGroupsV2(User().Email, true).value, Value=gTelecomManagersGroup)));

 Stephane

alrez
Community Support
Community Support

Hi,

 

Thanks for your post! I am glad that you were able to get this issue resolved. Hopefully this will prove useful for future communities users.

 

Regards,

 

Alex

 

-------

 

Community Support Team _ Alex Rezac
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (2,138)