How to restrict a table to a specific user

Hello,


Outsystems Server Studio 11


The application you are trying to create is on the traditional web.


I have a project details window that contains a table that allows members to be added to the project but I want to restrict that table to appear only for the type of logged in user Consultant.


My user entity has reference to a static user type entity that allows users when they register to choose their type of user, and I created roles for each type of user.


Now how can I rest the table just to be seen for users of the consultant type?

You have several scenarios.

Easy one: that role can't access the page at all. But you know that, so I guess you want something more specific.

For most cases, the user must see the page, but not a part of it. For that, the table and related widgets (search, filters, navigation, etc) go inside an If that checks role.

The most complex scenario is when a user can only see some rows of the table. For that, you must filter records in the query.

Which one is it?


Nuno Reis wrote:

You have several scenarios.

Easy one: that role can't access the page at all. But you know that, so I guess you want something more specific.

For most cases, the user must see the page, but not a part of it. For that, the table and related widgets (search, filters, navigation, etc) go inside an If that checks role.

The most complex scenario is when a user can only see some rows of the table. For that, you must filter records in the query.

Which one is it?


It is a window with details of the project where a table with the members is presented, but this table, so that you can view and interact with the type of consultant.

In this table I have an if with this condition ProjectId = NullIdentifier ()

But that's not what I want.


Hi Diana,

If you want to hide complete table for the type of user then  you can simply put table in a container and set condition on the visible property of the container. 

If it is true on runtime then it will show else it will.not display.

Regards,

Rajat Agrawal

Solution

You can use Rules Built-in functions, to management the access to a table.

Other thing that you can do, but just an example, because you have several options, you can put your table, into a container, and in properties of container, you can put this container visible, just for a set of users with a role. Other example, you can put the table into the if, and in if clauses you check if user have a certain role, if yes show, if not, don't show.


Extra information:

https://www.outsystems.com/evaluation-guide/role-based-access-control-for-outsystems-applications/

Solution