When deploying an app to a domain what is the default Userrole() value set for anyone from the domain using the app?
Iโd like to make an assumption that anyone who isnโt explicitly defined in the list of users allowed to use the app would get a value of โUserโ rather than โAdminโ so that I can then add explicit users as Userrole(โAdminโ).
Does anyone know whether Userrole() can be used this way? Or is it just for explicitly defined users in the Manage Users section of the editor?
The reason I asked is that a deployed app seems to think all domain users are Userrole(โAdminโ). This is actually my first app that uses Userrole in ShowIf expressions to hide a behaviour on a row of a table.
Could it just be that as I am the author of the app that it just gives me Admin role anyway?
An alternative to using that system would be to implement your own - pretty simple actually.
When you add users to your app, theyโre assigned the โUserโ role by default;
I might reach out to support@appsheet.com
Thanks for the tip and the link for implementing this. I do have a directory of users that I can pinch to get this working. Does it work with security filters though?
Indeed.
You can implement it two ways:
Index(Current_User[User_Role], 1) = "Admin"
or for multiple
IN(Index(Current_User[User_Role], 1), list("Admin", "Dev", "Others"))
LOOKUP(USEREMAIL(), Users, User_Login_Email, User_Role) = "Admin"
User | Count |
---|---|
43 | |
28 | |
24 | |
24 | |
13 |