@Phineas
The easiest way to achieve this :
1. Create a Sharepoint List called AdminList
2. Add Columns all single Text "FullName","Mail","Role" - the role is not important but that's if, in future you would like to restrict Admins based on a job role 🙂
3. Add the connection to this List from Power Apps
4. on Start, You will need to create a variable called IsAppAdmin it will look like this
Set(
varIsAppAdmin,
!IsBlank(
Find(
Lower(User().Email),
Concat(
AdminList,
Mail,
";"
)
)
)
);
5. Run OnStart to initialise this
6. go to the Visible gallery property and place the variable varIsAppAdmin there
7. Create a Settings button in the Menu also, use varIsAppAdmin to restrict access to the button
8. create form to add remove admins from AdminList
9. Enjoy full Admin Security 🙂
You can build a tier system like that also this is a simple option rather than building all that, You could rather the AdminList use AD Security Groups and use Office365Groups.ListGroupMembers("GroupToken").value to veryfie if someone is in the Security group called Admin also You can add few more Groups like that and power whole security of the app
to use this approuch it's nearly same but you create additional variable
Set(varAdminGroup, Office365Groups.ListGroupMembers("GroupToken").value)
Than You use same code as above :
Set(
varIsAppAdmin,
!IsBlank(
Find(
Lower(User().Email),
Concat(
varAdminGroup,
mail,
";"
)
)
)
);
the Mail need to be lower case for group 🙂
And then you control everything from AD Group and additional you have access to Job role Location and other properties of M365 User Account