I have a list inside the list there are multiple switch button i want to given the particular role by using these switch button like when i select manager switch the manager role should be granted or when i select teamlead switch the teamlead role should be granted but the problem is these switch button are inside the list
Hello @Shubham kushwah ,
You can use the Granrole function for granting the role to a particular user.
Yes but the problem is these switch button are inside the list i pass the variable value to switch button for grand employee role but when i click on the another switch button the employee logic working on all switch buttons
So after that, you can revoke it also by using the revoke function.
Hi Shubham,
Then use that Role ID for granting the selected role.
For granting that role, insert a record in the entity User_Role of System module (check duplicate before adding) to play safe.
Can you please show me how to do that i dont understand
I won't be able to fix the OML file you shared.
You're using a custom created Role entity, which is not a recommended approach. If you modify your application to use the default Role entity which is provided in System module. Just reference it from your app, and delete your custom Role entity.
Once you're done with that part, send me the OML file again, I'll get the issue fixed for you.
that role entity i created for showing record inside the list for switch button that entity has nothing to do with role
I did number of changes into your oml.
I added onChange action for users dropdown list to refresh getRoles aggregate
I also added swithch to grant and revoke employee action which you can add more roles condition
as per your application roles. Also I created new table called AppRole which its Id is SystemRoles table Identifier (I added Role_System table and user_Role from System module)
For the aggregate of returning roles (GetRoles) I did some changes
Kindly find updated oml attached