Hello All!
I want to create login page for admin in powerApps using CDS entity and do validation for it.
For example -
I have two screens -
Screen1 will have email or username and password.
Screen2 will be have customization form.
On screen1 if given credentials are correct and validated then only it should allow to edit the button for navigating to different screen or else it should not allow
How can we do this?
Solved! Go to Solution.
Hi @Saurabh-704 ,
Ok, that makes more sense. The method that I suggested of looking at the User() function is not appropriate in this scenario.
If you want to lock down who is a maker (admin) of an app then you should use Environment security and give users who are makers the Environment Maker role and all other end users should not have this role.
You have been talking about having different admins per app. If you want to achieve this then you will need to have an Environment for each administrator where they are the only person with the Environment Maker role. Otherwise it is not possible to split out different makers for different apps within the same environment as the maker permissions are environment wide.
-----
If this post has answered your question please consider it for "Accept as Solution" or if it has been helpful give it a "Thumbs Up".
Hi @Saurabh-704
Why do you want to create a login page for your app? The user will have to log into Office 365 to access the app and so at that stage you will have their user details available to the app through the User() function. You can use the user details to then to show or hide the edit button.
This post has a few different approaches or how you could do this.
-----
If this post has answered your question please consider it for "Accept as Solution" or if it has been helpful give it a "Thumbs Up".
Thank you @HSheild . But my requirement is different . Like I have to differentiate between admin and user.
And we have to give only one admin per application.
If we follow that user() function, then how can we give condition like after downloading whoever first login through there mailid will be by default admin? Like that!!
Hi @Saurabh-704 ,
I'm confused about what you are asking. Can you give an example of what an admin user would be doing? Are you talking about the admin being able to configure and edit the app itself.
Using the User() function you could (for example) have a CDS entity which represents a list of Admins for each app. Get your app to check this list in order to determine if the logged in user is an admin or not.
Thank You @HSheild for your response.
My requirement is that one application is there ...which will be customize by admin. Like if I am the admin then I will decide what fields should be there in user screen, what background image should be there for the user screen. So this customization can be done only by admin. So this is my requirement.
As in previous reply you said to check the list to determine if the logged in user is an admin or not. So can you please help we with these how to check the list in cds entity ?! Means what is the function to check the list in CDS entity?
Hi @Saurabh-704 ,
Ok, that makes more sense. The method that I suggested of looking at the User() function is not appropriate in this scenario.
If you want to lock down who is a maker (admin) of an app then you should use Environment security and give users who are makers the Environment Maker role and all other end users should not have this role.
You have been talking about having different admins per app. If you want to achieve this then you will need to have an Environment for each administrator where they are the only person with the Environment Maker role. Otherwise it is not possible to split out different makers for different apps within the same environment as the maker permissions are environment wide.
-----
If this post has answered your question please consider it for "Accept as Solution" or if it has been helpful give it a "Thumbs Up".
Thank you so much @HSheild for the solution. So does that means that whenever someone downloads the app they only have to do this environment setting?!
And can you also help me with that CDS entity list? Like how to check the list in order to determine if logged in user is admin or not. can you provide any link or any function for these?!. (Like if our team decided to go with this check list solution).
User | Count |
---|---|
25 | |
23 | |
7 | |
6 | |
5 |
User | Count |
---|---|
28 | |
26 | |
10 | |
9 | |
5 |