Records visibility depending on login and user role

Hi all,

I have a table listing Companies. Some of them can be displayed on our intranet, some others are to be available only to the corporate staff.

By default, Companies page shows all the records but I have set a "Visible YES/NO" field so that I can enter Companies in the database while controlling their visibilty. But it only works because I have access to the admin page of the app. This "Visible" criterion sounds quite artificial.

I would like to use the user roles so that there are two different views of my Companies listing.

Someone who is not logged should be able to see all the "unrestricted" companies. Someone logged in could see the additional companies AND the public companies.

So far, I have seen methods to see your own records, but I don't want the company visibility to be based on a unique user basis, but that someone with the proper role could see the "hidden" companies + the usual ones.


Many thanks.

What you do is:

On the same PAGE, create two different views, one that has ALL the fields/columns and another one more restricted.

Then go to Page Rules and add a new rule based on USER ROLES, there you can control witch view you want to hide based on the user role that is logged in.