689
Views
3
Comments
Solved
How to give visibility of container widgets and button widget based on roles

In my application, I have three roles employee, travel desk and manager. so I have a container(travel desk) which should be only visible to travel desk, also have a button which should be only visible to manager. How to do this?

2021-06-02 20-50-04
Márcio Carvalho
Solution

So you need to get the roles using a data action to check for the roles, after that inside of the visible widget you can put a condition to be visible in case they have the "x" role.

Add an output parameter to see if has the role, the data type will be boolean for both

Call the action check role that you have in the role actions, first drag the run server action to the data action

Assing the output

And do the same for the travel desk role inside of the data action


Then on the visible input in the container open the expression editor

Call the output of the data action

And that's it, now is going to be visible if the logged user has the role.

There is also another post explaining this

https://www.outsystems.com/forums/discussion/62878/how-to-define-seen-or-unseen-button-with-roles-in-reactive-app/

Regards,

Márcio

2022-03-25 09-38-41
shalini shivaram

Hi Marcio,

Can you please elaborate on how to check roles using data action?

Regards,

Shalini

2022-03-25 09-38-41
shalini shivaram

Thank you so much Marcio for the solution

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