Having different roles and assigning them

Hi,

I am currently creating a native app and there will be 3 roles: admin, supplier and consultants. I was planning to make 3 separate modules for each of these roles as each roles are only allowed to view and access certain information and screens. 

However, if i were to join all the screens in one module and have a "redirect" screen and adding a "redirect" client action in the OnInitialise of the "redirect" screen. In that client action, i will redirect users to the correct screens depending on their roles. Is it a wise decision to do that? 

And also are there other ways where i can put everything in one module and assign the respective roles correctly? 

Hi Jolene,

For mobile all screens need to be in the same module.

You can limit in the same module per screen which roles are allowed to access it.

Furthermore you can condition the links buttons that access the screens by checking the roles to.

To either disable ot hide them when the user has not the correct role.

Regards,

Daniel

Daniël Kuhlmann wrote:

Hi Jolene,

For mobile all screens need to be in the same module.

You can limit in the same module per screen which roles are allowed to access it.

Furthermore you can condition the links buttons that access the screens by checking the roles to.

To either disable ot hide them when the user has not the correct role.

Regards,

Daniel

Hi Daniel,

How do i go about doing the conditioning of link buttons and hiding things when user do not have to correct role? 

Currently, i doing this in the OnInitialise of the "redirect" screen, i dont know if this is the best way to do it.

Hi,

Yes that is a good to do it. This way you can access the server side role actions.

This is a safe way, BUT it requires internet connection.

Alternatively you can check role client side. It is less safe but works also in offline scenarios.

https://success.outsystems.com/Documentation/10/Reference/OutSystems_APIs/JavaScript_API/Security

You need to use a javascript widget in this situation.

Regards,

Daniel

Hi Jolene,

For applying role based access you should do two steps.

1. Select only those roles in screen properties for which you want to allow access to the screen.

2. Set visible property of the links based on the user role. For checking user rolw on client side you can use checkifcurrentuserhasrole method from OutSystems Javascript API. Just check role in oninitialize of the menu block or screen and use its result in visible property of the link widget to hide/ show.

You can find more information about them on below link:

https://success.outsystems.com/Documentation/10/Reference/OutSystems_APIs/JavaScript_API

https://success.outsystems.com/Documentation/10/Reference/OutSystems_APIs/JavaScript_API/Security#checkifcurrentuserhasrole

Hi all,

Thanks for replying and for all your suggestions! I will be sure to check it out.