145
Views
6
Comments
How to make a page read only to a Role/ User?

I have a page and i have different Roles. I want to make the page  readonly to specific roles? 

2020-05-07 18-53-00
Rui Barradas
 
MVP

Hello Prabinraj,

Hope you're doing well.

Associated to a Role, you have the Check<Role>Role action.

You may use the output of this action and control the features in your screen that should be available or not for certain roles.


As an example, let's say you have 2 roles: Admin and User.

The page will be available for both of them to read the data, but only Admins can change the data. You can use the CheckAdminRole action and use its output to control if the Save Button is available or not in the page (with an If widget in the screen).


Kind regards,

Rui Barradas

2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP

Hi Prabinraj,

What you could consider is to make a separate screen that is read only and assign the roles to it.

From a security point of view, create separate screen for create/edit/delete and another one for view only is a good practise.

It also allows you to style the read-only screen differently.

Regards,

Daniel

UserImage.jpg
Prabinraj TP

i have two roles Service agent 1 and Service agent 2,so service agent1 should able view and edit his page and view only for service agent 2's page " how can i build this procedure? 

2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP

Your rephrased question still can be handled with my original reply.

2019-04-23 11-32-25
Muhammed Riyas

Hello Prabinraj TP, 

You can validate the role using CheckRole action.

You can show or hide the edit button/link based on the role.

It's totally based on how you build the screen; can you share your oml file to look closer at the issue you are facing and suggest a solution?


Regards,

Riyaz

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

Hello

You can use a data acion to call the check role action into it , then just take an output from it a boolean type, it will return either true or false

based on your output bind your field with it for example

on your input fields you have enable property assign your condition and you can disable it, You can also disable the button same way, however user can also inspect and change it from developers tool,

So you can use IF conditions and display the result in text instead  of input fields and hide the buttons.


Hope you understand 

Thanks 


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