1010
Views
8
Comments
Solved
How to hide menu and buttons based on role?

How to hide menu and buttons based on role?

2021-03-05 13-56-11
Ricardo Pereira
 
MVP
Solution

Hi,

You can check this post and use the same approach. Please, see all the responses, maybe the JS approach (by João Marques) is a nice one: https://www.outsystems.com/forums/discussion/67036/how-to-hide-buttons-based-on-role/

Hope this can help.


Best regards,

Ricardo Pereira

2024-11-20 08-28-20
Pedro Marques
Solution

Hi Aneena,

You can use an If widget to achieve this.

In the condition of your If you should evaluate if the user has the specific role you want to check, and then place your button, menu item, etc... in the True branch.

For more information please check these links:

https://success.outsystems.com/Documentation/11/Reference/OutSystems_Language/Interfaces/Designing_Screens/If_Widget (regarding the if widget)

https://success.outsystems.com/Documentation/11/Developing_an_Application/Secure_the_Application/User_Roles/Validate_End_User_Permissions_in_the_Application (regarding the roles)

2025-04-17 05-42-16
Ajit Kurane
Solution

Hello Aneena,

Please check below post and there is one oml file also. You can refer it.

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

Regards,

Ajit Kurane.

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

Hello, so as we can see, there is a lot of information, just choose or look at all the information. Any doubts we are here to help you if you need.

I will leave here some more links

https://www.outsystems.com/forums/discussion/67842/how-to-set-a-button-from-menu-invisible-depending-on-user-role/

https://www.outsystems.com/forums/discussion/40330/how-to-disable-or-enable-button-based-on-user-roles/

https://www.outsystems.com/forums/discussion/55602/how-to-check-role/

Next time someone asks this same question, this will be the link that I am going to give and only this :D

Wish you the best!

Regards,

Márcio

2021-03-05 13-56-11
Ricardo Pereira
 
MVP
Solution

Hi,

You can check this post and use the same approach. Please, see all the responses, maybe the JS approach (by João Marques) is a nice one: https://www.outsystems.com/forums/discussion/67036/how-to-hide-buttons-based-on-role/

Hope this can help.


Best regards,

Ricardo Pereira

2024-11-20 08-28-20
Pedro Marques
Solution

Hi Aneena,

You can use an If widget to achieve this.

In the condition of your If you should evaluate if the user has the specific role you want to check, and then place your button, menu item, etc... in the True branch.

For more information please check these links:

https://success.outsystems.com/Documentation/11/Reference/OutSystems_Language/Interfaces/Designing_Screens/If_Widget (regarding the if widget)

https://success.outsystems.com/Documentation/11/Developing_an_Application/Secure_the_Application/User_Roles/Validate_End_User_Permissions_in_the_Application (regarding the roles)

2022-12-03 12-19-54
Aditya C

Hi Aneena,

You can try what Ricardo and Pedro suggested.

Else, You can make this possible if you insert the button or menu item in a container and in the containers visible property add the check role logic, like,

if (IsManager or IsAdmin, True, False)

This IsManager or IsAdmin are the Boolean values for the Rolecheck purpose.

2021-03-05 13-56-11
Ricardo Pereira
 
MVP

Hi Aditya,

Just one point: You don't need to validate with an If with the true and false branches. You just need to use the true condition to validate (in this case, you just need to use the IsManager or IsAdmin).

And it's better to use an If widget instead of the visible property of the container, because with the If its guaranteed that the container don't appear in the HTML.


Best regards,

Ricardo

2022-12-03 12-19-54
Aditya C

Hi Ricardo,

Yeah You are right. I thought that the requirement is just for one or two items, so that's why I suggested it. Thanks for the information.


2025-04-17 05-42-16
Ajit Kurane
Solution

Hello Aneena,

Please check below post and there is one oml file also. You can refer it.

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

Regards,

Ajit Kurane.

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

Hello, so as we can see, there is a lot of information, just choose or look at all the information. Any doubts we are here to help you if you need.

I will leave here some more links

https://www.outsystems.com/forums/discussion/67842/how-to-set-a-button-from-menu-invisible-depending-on-user-role/

https://www.outsystems.com/forums/discussion/40330/how-to-disable-or-enable-button-based-on-user-roles/

https://www.outsystems.com/forums/discussion/55602/how-to-check-role/

Next time someone asks this same question, this will be the link that I am going to give and only this :D

Wish you the best!

Regards,

Márcio

UserImage.jpg
Aneena Susan Thomas

Thank you all, I got the answer to my question.

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