Screen role-based access. Two roles mandatory
Application Type
Traditional Web, Reactive

Hi there

In the application we are developing our customer has defined a list of roles.

The problem for us is that, to access some screens the user needs more than one role assigned. In other words, the relation among this roles must be an "AND". For other screens the boolean expression can be a combination of "OR" and "AND".

As far as we know, Outsystems always applies an "OR", so for screens that have more than one role assigned, the system let the users enter the screen if they have at least one of the roles.

How can we override this behaviour so, we can define at least two mandatory roles to be assigned to the users, in order to let them enter the screen ?


Thanks a lot in advance

I think you can check role custom method like on Data Action or Screen Initialized and according to navigate to screen 

Champion

Hi,

As you mentioned that default behavior is to check the role for any screen. I am not sure what should be best approach to achieve this. 

But as per my understanding to check multiple roles you need to write some logic, either on screen load or before navigate to screen you can check for both roles manually. You can also create a group and assign both roles to this group and check for group. Or also can create one super role means if user have both role 1 and role 2 then assign this super role to user. So on screen you can allow for this super role only.

regards

Hey @Francisco Alberto Donat Guijarro 

There are 2 solution to this 

Technical: I guess you have to create check role on "OnInitilize" where we have AND combination 

Logical change in workflow:  Something simplified create a parent role which is assigned to someone having more than role. This method may be lengthy but will be good for expansion perspective.  

Thanks
Shlok Agrawal

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