Thank you for choosing Microsoft Power Platform Communities.
To achieve this in PowerApps, you can follow these steps:
Retrieve the User's Environment Role
Use the Power Platform Admin Center to manage and retrieve user roles. You can access the roles assigned to a user by navigating to:
Environments > Settings > Users + Permissions > Security Roles
Check out these helpful links
To address your requirement for a flow,
Build a Flow to Check Roles:
Use Power Automate to create a flow that runs when the app starts.
The flow could:
-Query the Dataverse table or API to check the user's assigned roles.
-Return the role information to PowerApps.
Navigate Based on Role
In PowerApps, use the flow's output to determine if the user has the necessary roles.
If the user lacks the required roles, navigate them to a page with instructions on how to request access. You can use the Navigate() function in PowerApps to achieve this.
Request Access Page
Create a form in PowerApps where users can request access. This form can trigger another flow in Power Automate to send an email or update a Dataverse table with the request details.
If you have any further questions or need additional assistance, feel free to ask!
Happy to help,
Robu1 | Microsoft Community Super user & Moderator