Hi,
I am new to App Sheets and creating a business lead entering and viewing app. Can anyone please guide me how to full-fill below requirement.
User role and restrictions requirement
Assign different user roles (admin, manager, supervisor, user) and assign different permissions.
Admin: Access all features, Views and menu items, Create all types of users
Manager: Create supervisor and user accounts, Add own leads, View and edit all leads
Supervisor: Create only user accounts, Add own leads, View and edit own and supervisor assigned user leads
User: View, Add and Edit only own leads
Note: I have created two tables in google sheets for user details and lead details
Thank you,
Sam
Solved! Go to Solution.
@Sameera_De_Silva
You need to create your own USERS table with ROLES and ACCESS PRIVILEGES. As per this table, you can use LOOKUP() expression to locate any userโs role and access privilege to any table and set your tableโs access mode and (if needed) security filter expressions to filter away data.
Out of the box, AppSheep currently only supports Admin and User as roles for any whitelisted users. I have heard some buzz that they may have capability for more in the future.
Since you need more than the two roles, you will need to build and manage your own but itโs not hard IF you are using AppSheetโs user login feature.
In your Users table, add a column for Roles and a column for Email. When adding Users make sure that the Email column is populated with the email the user authenticates with to access the app.
Then itโs just a matter of grabbing the userโs Role and using that value for security checks throughout the app. To get this value the expression might be:
ANY(SELECT(Users[Role], USEREMAIL() = [Email]))
I have also seen some developers use a slice to make this easier in the app. For example create a Slice, maybe named Current User, with the criteria USEREMAIL() = [Email]
. Since a Slice can be treated as a table, you can then get the role by this expression Current User[Role]
.
Hi Willow, I tried to make this up for hours and hours and i didnโt slept properly for last 24 hours. I canโt fix it after trying numerus times. but i donโt want to give-up,
So i have decide to make it more simple for now in order to finish this project quickly. If you donโt mind can you please help me up.
New method as below
Only two user roles which โAdminโ and โUserโ provided by app sheet in user section. I will allow one domain (under Gsuite) to so all the user under this domain will validate through google auth and login/ or maybe add users one by one by defining user role.
Permission : (same slice/UX will filter each lead and show based on Admni or User role)
From Appsheet user log/ monitoring I will audit the user activities later
Thank you,
Sam
@Sameera_De_Silva
You need to create your own USERS table with ROLES and ACCESS PRIVILEGES. As per this table, you can use LOOKUP() expression to locate any userโs role and access privilege to any table and set your tableโs access mode and (if needed) security filter expressions to filter away data.
Thank you LeventK, I will try this. Thx.
Youโre welcome. Please read the documentation and put your best effort and make your hands dirty a bit more with further trials. Provided you cannot manage it or you donโt receive a satisfactory result, you can always come-up with Qs. We are here to help and provide assistance to the best of our knowledge and experience. Learning Curve is a bit steep, needs some patience and trial&errors. Otherwise it will be just a copycat of one and you will possibly learn nothing at the end.
Thx for the quick reply Willow. I will try this and update you soon. Thx again.
Yes sure,. Totaly agreed. I will try again and update,. Thx.
Perfect. Youโre welcome and itโs my pleasure to be helped of.
Hi LeventK,
I donโt have enough words to thank you. I was able to limit leads to user level: own leads only, manager level: all leads (view, add & edit).
This was the link you sent where I have found exactly what I wanted : https://help.appsheet.com/en/articles/1128148-limiting-users-to-their-own-data
Only thing to do now is create a different menu item for create manager accounts in app (MANAGER_TABLE). The problem Iโm facing is when I create the menu item all users can see the โCreate new adminโ menu tab. I needs to make it accessible only for emails in MANAGER_TABLE > Email ID column users.
Can you please guide me how to hide a menu item based on the manager email column. All emails in โEmail IDโ column should able to view, add, edit specific โcreate managerโ UX/ slice. It should not visible to other users.
Thank you,
Sam
@Sameera_De_Silva
Each UX view has a Show_if property under Display. You can use a similar expression there to show/hide that UX view to certain user set. Very similar to showing/hiding data.
I have used the same expression and got it done,. Thank you verymuch LeventK. Now its ready to deploy
Perfect, congrats.
User | Count |
---|---|
33 | |
29 | |
29 | |
20 | |
18 |