I need my users to be able to control the app roles themselves. In other words, I do not want to keep giving permissions per user. Once i give the app to my users - they will be able to add users as needed and give roles to them. Is that possible?
Solved! Go to Solution.
@Tiger
Something like thisโฆ
ROLES TABLE
Column Name | Column Type | Base Type | Key? | Initial Value | App Formula | Valid_If | Suggested Values | Input Mode |
---|---|---|---|---|---|---|---|---|
USERROLE | Enum | Text | - | - | ={โOwnerโ , โSuperadminโ , โAdminโ , โUserโ} | - | Buttons | |
ACCESS TYPES | Enumlist | Text | - | - | - | =SWITCH([USERROLE],โOwnerโ,{โALL_CHANGESโ},โSuperadminโ,{โADDS_AND_UPDATESโ , โADDS_AND_DELETESโ , โUPDATES_AND_DELETESโ , โALL_CHANGESโ},โAdminโ,{โADDS_ONLYโ , โUPDATES_ONLYโ , โDELETES_ONLYโ , โADDS_AND_UPDATESโ , โADDS_AND_DELETESโ , โUPDATES_AND_DELETESโ},{โADDS_ONLYโ , โUPDATES_ONLYโ , โADDS_AND_UPDATESโ}) |
USERS TABLE
Column Name | Column Type | Base Type | Key? | Initial Value | App Formula | Valid_If | Suggested Values | Input Mode | Source Table | isPartOf? |
---|---|---|---|---|---|---|---|---|---|---|
USER_ID | Text | - | =UNIQUEID() | - | - | - | - | - | - | |
FIRST NAME | Text | - | - | - | - | - | - | - | - | - |
LAST NAME | Text | - | - | - | - | - | - | - | - | - |
USEREMAIL | - | - | - | - | - | - | - | - | - | |
USERROLE | Ref | - | - | - | - | - | - | Buttons | ROLES | - |
PRIVILEGES | Text | - | - | - | =[USERROLE].[ACCESS_TYPES] | - | - | - | - | - |
TABLE UPDATE MODE
LOOKUP(USEREMAIL(),"USERS","USEREMAIL","PRIVILEGES")
In a way itโs possible (from access privileges perspective only. As you are an account holder, you need to whitelist each user email via AppSheet Editorโs Users Interface) if and only if you preset/predefine which userset can give/distribute which access privilege. Otherwise the app data will totally be out control.
Good point! I was going to go through each view, button etc and give permissions based on my user role table.
@Tiger
Something like thisโฆ
ROLES TABLE
Column Name | Column Type | Base Type | Key? | Initial Value | App Formula | Valid_If | Suggested Values | Input Mode |
---|---|---|---|---|---|---|---|---|
USERROLE | Enum | Text | - | - | ={โOwnerโ , โSuperadminโ , โAdminโ , โUserโ} | - | Buttons | |
ACCESS TYPES | Enumlist | Text | - | - | - | =SWITCH([USERROLE],โOwnerโ,{โALL_CHANGESโ},โSuperadminโ,{โADDS_AND_UPDATESโ , โADDS_AND_DELETESโ , โUPDATES_AND_DELETESโ , โALL_CHANGESโ},โAdminโ,{โADDS_ONLYโ , โUPDATES_ONLYโ , โDELETES_ONLYโ , โADDS_AND_UPDATESโ , โADDS_AND_DELETESโ , โUPDATES_AND_DELETESโ},{โADDS_ONLYโ , โUPDATES_ONLYโ , โADDS_AND_UPDATESโ}) |
USERS TABLE
Column Name | Column Type | Base Type | Key? | Initial Value | App Formula | Valid_If | Suggested Values | Input Mode | Source Table | isPartOf? |
---|---|---|---|---|---|---|---|---|---|---|
USER_ID | Text | - | =UNIQUEID() | - | - | - | - | - | - | |
FIRST NAME | Text | - | - | - | - | - | - | - | - | - |
LAST NAME | Text | - | - | - | - | - | - | - | - | - |
USEREMAIL | - | - | - | - | - | - | - | - | - | |
USERROLE | Ref | - | - | - | - | - | - | Buttons | ROLES | - |
PRIVILEGES | Text | - | - | - | =[USERROLE].[ACCESS_TYPES] | - | - | - | - | - |
TABLE UPDATE MODE
LOOKUP(USEREMAIL(),"USERS","USEREMAIL","PRIVILEGES")
Thank you very muchโฆ
@Tiger
Youโre welcome. My sample is just to highlight the path. You can and need to expand the idea for your own needs and app requirements. Provided you struggle, you can post your questions anytime and we will be glad to help you to fixโem.
User | Count |
---|---|
35 | |
30 | |
30 | |
20 | |
18 |