Assigning roles directly within the UI
Application Type
Traditional Web

Hope you are all well. I am creating an Admin page visible to Super Users that will enable them to select an employee and give them a certain role. My Use case is as follows.

Im creating a booking system, i have low level users who create bookings, Managers who authorise bookings, admin users who manage stock, and super users who have full access to all features. My pages are setup as i need them and features are only visible according the the Role of the user who is signed into my application. 

I have created my different roles ready for use. 

A super user will have access to an admin page which contains a form. within that form is a combo box listing the Employee Identification number of all employees. There is a button which has an action to AssignXXXRole to the Employee that is selected in the combo box. But i cant get t to work. here are some screenshots of my application, i think i am mapping things incorrectly but i have tried many different combinations. 

ROLES:

PREPERATION:

FORM DETIALS:


COMBO BOX:


Assign Role Action

Your Help and Advice is much appreciated.

Thanks

Mike

Hi @Michael Freath,

I created one demo .oml as per your problem statement. Further, you can modify as I took combo box to take the role(can convert into radio buttons).

I provided this link for the demo purpose:

http://personal-6qqoqcvk.outsystemscloud.com/AssignRolesDemo/AssignRoles.asp

Please check this oml file attached with this post.


Kind Regards,

Narendra Bhangale.

AssignRolesDemo.oml

Hi Narendra

Thank you for this. It looks like this will work. I am able to get it to function correctly so i am very Grateful. My list of roles however, for some reason contains hundreds of different options. If i apply a filter to the GetRoles in my preparation to only include the options i want this should be ok. Alternatively, Can i do this be creating my own Static entity and using this instead of the built in Roles Feature?

Thank you for your Help. I will mark this as solution

Mike

You're welcome, Michael.

Glad to help you :)

Regards,

Narendra Bhangale.

You can do with static entity, but then you have map those static entity with built in roles entity. Because in action flow you have to assign/grant selected value role to that user.

I have now managed to get it to change the Role of the person signed in i.e. Current user by creating a variable and and assigning my form to it. But this is not what i want it to do. one step closer i guess. 


Hi Micheal, As per your requirement It's suitable to allocate each role manually to every user. If it's possible then manage then on OutSystems users app and Enclose each functionality or screens to their role. suppose if you want to restrict the manager from superuser enclose the if in your app and assign them with the condition to check the admin role function make sure to unchecked the anonymous user.

In case you still need any assistance then feel free to connect with me. Also if possible then kindly share the OML file to understand and solve this.

Thanks & Regards, 

Hi Vinayak, Thank you for your response. The Page and functionality is setup ok, I dont have any issues with checking the users current role and only allowing access to certain functionality. 

This issue i am having is being able to change a users role within the application. i have got it so that a user can change their own role which isn't what i want, I need to to be able to change the role of the user selected within the dropdown and i cant seem to figure it out. 

Thanks

Mike

Hi Michael, 

It looks like you are defining the variable of the combo box to UsersTableExtensionForm.Record.UsersTableExtension.Id but when you call the GrantSuperUserRole action you set UsersTableExtensionForm.Record.User.Id as input instead.

If possible share the .oml and I'll try to help you.


Hi @Michael Freath,

I created one demo .oml as per your problem statement. Further, you can modify as I took combo box to take the role(can convert into radio buttons).

I provided this link for the demo purpose:

http://personal-6qqoqcvk.outsystemscloud.com/AssignRolesDemo/AssignRoles.asp

Please check this oml file attached with this post.


Kind Regards,

Narendra Bhangale.

AssignRolesDemo.oml

Hi Narendra

Thank you for this. It looks like this will work. I am able to get it to function correctly so i am very Grateful. My list of roles however, for some reason contains hundreds of different options. If i apply a filter to the GetRoles in my preparation to only include the options i want this should be ok. Alternatively, Can i do this be creating my own Static entity and using this instead of the built in Roles Feature?

Thank you for your Help. I will mark this as solution

Mike

You're welcome, Michael.

Glad to help you :)

Regards,

Narendra Bhangale.

You can do with static entity, but then you have map those static entity with built in roles entity. Because in action flow you have to assign/grant selected value role to that user.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.