Userrole() default values

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?

1 3 283
3 REPLIES 3

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;

  • but with the domains integrationโ€ฆ perhaps thereโ€™s something getting in the way or mixed up.

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:

  1. pull values from your Current_User (slice)

Index(Current_User[User_Role], 1) = "Admin"
or for multiple
IN(Index(Current_User[User_Role], 1), list("Admin", "Dev", "Others"))

  1. do a hard lookup from the user table.
    LOOKUP(USEREMAIL(), Users, User_Login_Email, User_Role) = "Admin"

I prefer the first.

Top Labels in this Space