Hello Experts,
I have issue with grant and revoke role from dropdown tag list.
1) If I select roles from dropdown list it should be grant to that perticular user.
2) When I select perticular user and open dropdown then which roles already have that user it should be marked as secected in dropdown list
3) When I deselect perticular role check box then that role should be revoked from that user and after click on save button data should be updated.
Hope you all have understood my issue.
Please update below oml file.
Many thanks in advance.
Hello Alexa,
Kindly find attached OML with implementation of granting roles, select current roles assigned to each user into dropdownTags and revoke roles from users.
I updated oml to be more dynamic once you add new roles to your application
1. First you need to save your selected tags in list variable:
2. Create server actions for granting roles:
3. Iterate through the list variable items in the 'Save_Info Action' depending on condition:
Hope this helps you:
Can you please update the same in oml file
Hi Alexa,
The suggestions given by Shubham may work for your use case. But it can be a bit difficult when you keep on adding multiple roles in your other applications and wanting to have them listed and managed in this app automatically. In this suggestion you need to again edit this module and include more and more IF ELSE constructs to accommodate more roles.
You can however do this dynamically as an alternative option. Read the following forum posts about this:
https://www.outsystems.com/forums/discussion/83905/grant-roles-by-using-switch/
https://www.outsystems.com/forums/discussion/76640/how-to-create-and-assign-roles-from-ui/
https://www.outsystems.com/forums/discussion/9401/dynamic-role-creation-and-role-based-access-to-pages/
fully agreed with you thats what I was facing the same so that I have provide the oml file.
That would be great if you update my oml file.
Thanks.
I have figured out the solution. Please find the attached OML.
Its not working as per requirement.
What issue you are facing? It is working at my end.
please share demo link
I am sorry but if I share the demo link, It would create a conflict in my applications if you grant or revoke roles of my users.
you can share snap also. When I select role from dropdown then it reflects to all the users as selected in dropdown. Its not meeting my requirement.
Are you trying to say that roles are not updated user specific?