Standards, best practices and how-tos for developing OutSystems applications
This how-to guide describes follows the Reactive web security best practices and shows you how-to securely hide content from unauthorized users in the following situations:
When you fetch data from the database add a filter to the aggregate to check if the user has the required role e.g. CheckEmployeeManagerRole()
Inside the Data Action start with a CheckRole and exit the action with empty output if the user does not have the role.
Using the same approach as for the hidden class set the condition of the if to <UserHasSomeRole>()
Be aware of side effects when you put some widgets inside an If widget e.g. hiding a TabsContentItem with an if will break the styling of the tabs.
Scenarios:
To redirect a user to a specific page based on the user his authorization we can create a redirect page and use the JavaScript_API to check the roles to redirect the user. Each page is authorized to the specific role so even if the user is able to manipulate the page or goes directly to the page he will not have unauthorized access.
OnInitialize
event to the page