246
Views
9
Comments
Solved
User Role access permission
Question

Hi Team,

I have an requirement like i created two users and two roles exm:- User one is -ProdTest, second is- DevTest likewise Manager, Cleark roles in reactive web application.

From user console i have added user ProdTest to manager role and DevTest to Cleark role

now i have created a screen(FeedBack) and both user can able to see screen details but only manager can edit the rating section, but not Cleark.

could you please advise me how to achieve this.

2023-10-21 19-42-11
Tousif Khan
Champion
Solution

So to elaborate it more I have created a sample application for you, which ahas 2 roles and I have created 2 Users for it, and the roles are manager and clerk

I have created a direct login based on the roles, for the manager, you can click on the manager button, and for the clerk, you can click on the clerk button.

based on the role you click you will be logged in.

Now we have a home page which is a list page that is common to both the users,

Now once you click on the detail page it is different for both clerk and manager. manager will have access to edit the data but the clerk can only see the data, all fields in the form are disabled for the clerk user.

To get the permission of the manager we have created a data action on the detail screen. We are getting the value which is a boolean value.  The check role action returns the value whether the user who is logged in has that role or not, if he has the role then it will return true else false. 

Now we assign the true false to the output variable that we created on the data grid, the variable type must be boolean.

now once we get the value. we can assign the value to the fields if we want to hide then on the visible property we will assign the value, and for disabling we will assign the value to enable the property of the widget.

I am attaching oml for you that has all the practical guide

Sample Link - https://personal-ejuytnht.outsystemscloud.com/RoleBasedSecurity/Login

I hope this will help you.

Best Regards
Tousif Khan


RoleBased Security.oap
UserImage.jpg
kishore reddy

Hi Khan,

from your screen print OSMDBbAdmin_RoleCheck is that role you created or by default it was populating. since i am not able give role check in expression  what i created.

I created managerBooking Role now i want to give when manager is logged and he is allowed to  edit Feedback screen rating. 

other Role ClearkRole who has access to this role he shouldn't edit it.


2023-10-21 19-42-11
Tousif Khan
Champion
Solution

So to elaborate it more I have created a sample application for you, which ahas 2 roles and I have created 2 Users for it, and the roles are manager and clerk

I have created a direct login based on the roles, for the manager, you can click on the manager button, and for the clerk, you can click on the clerk button.

based on the role you click you will be logged in.

Now we have a home page which is a list page that is common to both the users,

Now once you click on the detail page it is different for both clerk and manager. manager will have access to edit the data but the clerk can only see the data, all fields in the form are disabled for the clerk user.

To get the permission of the manager we have created a data action on the detail screen. We are getting the value which is a boolean value.  The check role action returns the value whether the user who is logged in has that role or not, if he has the role then it will return true else false. 

Now we assign the true false to the output variable that we created on the data grid, the variable type must be boolean.

now once we get the value. we can assign the value to the fields if we want to hide then on the visible property we will assign the value, and for disabling we will assign the value to enable the property of the widget.

I am attaching oml for you that has all the practical guide

Sample Link - https://personal-ejuytnht.outsystemscloud.com/RoleBasedSecurity/Login

I hope this will help you.

Best Regards
Tousif Khan


RoleBased Security.oap
UserImage.jpg
kishore reddy

Hi Khan, 

Fantastic..!! it is working as i expected. i did not created Data action that's the reason i am not able to set permission for specific input fields.


Thanks for solution  

UserImage.jpg
kishore reddy

Hi,

I have an doubt since you applied user role on 'Enabled'  condition on UI screen for each input_fields. can't we apply entire screen for the specific users to UI Screens ?

2023-10-21 19-42-11
Tousif Khan
Champion

Yes we can do that, In that case we just need to check the Roles property on screen 

You can also refer to this video for tutorial https://www.youtube.com/watch?v=1FAPLpQ_KIQ

Thanks
Tousif Khan

2023-10-21 19-42-11
Tousif Khan
Champion

Your welcome, I’m glad I was able to help :)

Tousif

2023-06-07 04-47-12
Ayush Tyagi

Hello @kishore reddy ,

You can use any of the one either visibility of container or Enability of button according your use case.

1. Button used to edit the rating : you can disable it and enable only when the user has a manager role.


2. Hiding the container : According to me this would be the most suitable solution to your question , you can Hide the container by using property section and make it visible only and only when user has manager role.

I hope this helps.



2025-02-10 17-24-13
Arun Rajput

Hi @kishore reddy,

there is check role action with every created role,by using this action you can hide and show rating section for specific role.

Thanks,

Arun

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