User Roles

Hi all, How can I can create an app with 3 roles, logging by their email

  1. Officer : can view there clients only
  2. Manager: manage officers , can view their officer accounts only
    3: High management and Admin (me) : all officers account will be showed up in his/her app and me

Welcome to the AppSheet community.

Please take a look at the following articles to get initiated on the topic , including difference between the security filters and slice filters from the security point of view

3 Likes

Hi @Suvrutt_Gurjar , thanks for your reply but I just very new for the building app stuff and still could not do it
I have finished 90% of the app, just waiting for security filter and 1 more function to be finish
The app is very simple:
it contain a user table which have the officers accounts, then I referenced it with clients table, from the clients table will be referenced to the KPI performance of that officer’s Client
for example: officer A handle clients 1 ,2
officer B handle clients 3,4
officer C handle clients 5,6
officer B handle clients 7,8

  • When officer A logging will see clients 1 and 2, the same with B, C , D
    Manager E manage officer A,B
    Manager F manage officer C,D
    when logging will see the account of Officer A and B the same with Manager F
    and there have another role
    High manage team name G, H
    admin: me
  • when I and G,H logging will see the account of A,B,C,D
    Could anyone help please ? I try the instruction you link above still not work , I created a table name manager, and have this expression
    OR(IN(USEREMAIL(), Manager[Email]), USEREMAIL() = [Email])
    only work with the account of A,B,C,D but not work with the managers…
    Thank you

The shared article was to give an idea to the readers how role-based security filters can be implemented. You have as many as three different levels of managers. You will need to accordingly build your users/managers table and/or filter expressions.

1 Like

Hi @Suvrutt_Gurjar , sorry here I am again , I have 2 table, one is Users table , the others is Manager table. The user table have name of officers and their email, the Manager table is the same (name and email of manager) , I used this security filter in User table as below:
OR(IN(USEREMAIL(), Manager[Email]), USEREMAIL() = [Email])
It can filter the view of officer email. But It is empty (not working) with manager email. Do you know why ? thanks

In general, the expression looks good.

Earlier you mentioned senior managers, managers, officers etc. Your latest post mentions two tables- users and managers. Could you please update which table’s security filter you are using the expression you have shared and in the expression, the officers’ table is not referred? Also in which table the [Email] column is there?

Hi @Suvrutt_Gurjar , I using the expression in the User table. in the user table have the officers accounts, then I referenced it with clients table, from the clients table will be referenced to the KPI performance of that officer’s Client

I just changed the “Email” collumn from the manager table to “Manager Email” and the expression working now . the manager can see all the officers now.But it is not what I want . My company structure is something like this
officer A handle clients 1 ,2
officer B handle clients 3,4
officer C handle clients 5,6
officer D handle clients 7,8

  • When officer A logging will see clients 1 and 2, the same with B, C , D
    Manager E manage officer A,B
    Manager F manage officer C,D
    when Manager E logging will see the account of Officer A and B the same with Manager F
    and there have another role
    High manage team name G, H
    admin: me
    when me and G,H logging will see the account of A,B,C,D
    So what can I do to get there ? I have to make another table for high management team ?
    What can I do to make this “Manager E logging will see the account of Officer A and B” happen ?
    thanks for your support

I am sorry that you have mentioned different information in different posts. Also in general the security filter expression needs to be used not in user’s list but a table ( maybe client in your case) wherein you need to filter the data based on user roles.

Information shared by you suggests that you are trying to implement user roles in a few interconnected tables. As such, your requirement seems to extend beyond discussion on one expression.

I believe one will need a thorough understanding of your all data schema before suggesting any approach on a critical aspect like security filters.

Someone else in the community may help you better.

1 Like

Hi, Sorry. Here I am again . I try to finish this project. I watched the appsheet training video

IFS(
ANY(Current_User[Role])=‘Super’,
TRUE,
ANY(Current_User[Role])=‘Admin’,
OR(
[User]=USEREMAIL(),
AND(
[USER].[Region]=ANY(Current_User[Region])
[USER].[Role]=‘Non-Admin’
)
),
TRUE,
[User]=USEREMAIL()
)
what is [USER].[Region] ? how can I make a reference between column [USER] and [Region] since they are in same table ?