@RezaDorrani and i have been working for a couple days on a related issue here... Thought it was all resolved, but there seems to be a bug in the way Edit App Role Assignment is adding/removing users from the PowerApps permission list.
Trying to build self-service permissions into a PowerApp where app admins can add/remove users from their app.
Steps to reproduce:
In the PowerApp
Click "Add User"
Search for users name in a People picker combobox (tied to Sharepoint Person-type column)
SubmitForm() creates a new record in the Sharepoint "Access" list
"AddRemove" column set to "Add"
Trigger: When a Sharepoint Item is Created or Modified in "Access" list
If "AddRemove" column = "Add"...
Action 1: Sharepoint HTTP
Adds user to Sharepoint Permission Group (for Sharepoint access)
Action 2: Edit App Role Assignment
Adds user to the PowerApp
This adds the Users name to the PowerApp under "Share", BUT the user cannot access the PowerApp!
They receive the error:
And after clicking "Request Access", I receive a request email...
If I look in the "Share" area of the app, the user in question is listed, but they cannot access the app!
Only after I type in their name and click "Share" from this screen, can they access the app!
If I remove their access using the Flow that @RezaDorrani assisted with, the user loses access again BUT their name is not removed from the "Share" screen!
There is no way to remove their name from the "Share" screen. Clicking the "X" next to their name temporarily removes their name, but there is no "Save".
As soon as the "Share" screen is closed an opened again, the name reappears (though the user still does NOT have access).
Need some guidance here... approaching two days trying to get this solution working. Feel like I'm in a mess now!