
Announcements
I am facing challenges in implementing access control logic in a Power Apps application based on user tags in a Microsoft Teams group. I need to get two buttons enabled or disabled based on user tags in the Microsoft Teams group.
The buttons will be in DisplayMode.Disable or DisplayMode.Edit. In this case if the user has the tag such as "EditApp" tehy will be grant with DisplayMode.Edit otherwise these two buttons will appear DisplayMode.Disable.
Iam using the MicrosoftTeams.GetTags and MicrosoftTeams.GetTagMembers functions, I have not yet achieved a functional solution to check if a user has a specific tag and, accordingly, enable or disable the buttons. I am using Power Apps integrated with Microsoft Teams, and I do not have the specific ID of the "EditApp" tag, but I know it is named "EditApp.".
I was able to get all the tags in the group and the Users adding two dropdown. In the first dropdown drpFirst
I added:
MicrosoftTeams.GetTags(Param("groupId")).value
In the second dropdown:
MicrosoftTeams.GetTagMembers(Param("groupId"),drpFirst.Selected.id).value
In this way I was able to get group tags and each user that has the tags selacted in the first dropdown. Now I need to know how I can make the two Edit buttons I have to be Edit for those who have this tag and Disabled for those who don't. I also tried:
Set(
ModExibicaoBotoes,
If(
IsBlank(
LookUp(
MicrosoftTeams.GetTagMembers(Param("groupId"), "EditApp").value,
'email' = User().Email
)
),
"Disabled",
"Edit"
)
)
Any thoughts?
Thanks
Just a screenshot of how I retrieved the tag names and the users who have the tags. I don't want to use dropdown, it was just a test of how to retrieve the tag names and the tagged people.
I wanted to make this Risk button disabled or editable depending on the tag the user has.