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
Solved! Go to Solution.
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
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
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
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.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
186 | |
55 | |
42 | |
36 | |
33 |
User | Count |
---|---|
258 | |
78 | |
74 | |
71 | |
68 |