Switch of roles not working

Hi everyone!

I have a problem in my switch.

Captura0.PNG

I try to distinguish among some roles: admin, inspect, technician, employee:

admin: ALL_CHANGES
inspect: ALL_CHANGES
employee: READ_ONLY
technician: ADDS_AND_UPDATES

Captura1.PNG

Show More

The app distinguishes among the roles well. And it is shown with buttons with different actions depending on whether the user can add, edit or delete.

Ok, that's perfect, but the problem is that when an admin or inspect try: add, edit or delete the app fails. For example, when I add a register with a admin user:

 

Captura2.PNG

I waited a minute but not working, so I push on this button, and:

Captura3.PNG

Unable to add row to table 'Residuos'. โ†’ Table 'Residuos' does not allow this operation. Expression result: 'READ_ONLY'. Expression Trace: {"key": "SWITCH(ANY(SELECT(Usuarios[role],([EMAIL] = USEREMAIL()))),\"administrador\",\"ALL_CHANGES\",\"inspector\",\"ALL_CHANGES\",\"empleado\",\"READ_ONLY\",\"tecnico\",\"ADDS_AND_UPDATES\",\"READ_ONLY\")","result": "READ_ONLY","values": []}

I
think that my switch is ok, but i don't know why the app fails to add a register with admin

Thanks!

Solved Solved
0 19 1,126
3 ACCEPTED SOLUTIONS

When you have table like what I have done, you can change the user access based on access what you give.  secondly all those access can be edit or changed in the app interface. you need not change in table properties like switch(). 

It is kind of dynamic user controls. all amendments I do in app itself. I will not change in properties. 

jaichith_0-1693480458932.pngjaichith_1-1693480496292.pngjaichith_2-1693480523250.png

jaichith_3-1693480565409.png

 

View solution in original post

there will be 4 tables usually,

1. Users (Organisation Members)

2. Users Roles ( Admin, Manager etc)

3. User Permission ( What admin hold like All changes, Sales person only Adds_AND _ UPDATES etc)

4. Access or Permission Types - optional (It is like Adds_AND _ UPDATES, delete only etc)

This enables you to have like ERP software ๐Ÿ˜€

jaichith_4-1693481000436.png

 

 

View solution in original post

19 REPLIES 19
Top Labels in this Space