I’m seeking advice on best practices for handling data retrieval when different filtering requirements apply based on the user’s role or permissions.
To illustrate, I’ve created a data model with two classes: “Projects” and “Project Participants.” The “Projects” class includes a filter to show only projects where the user is a participant:
Now, I’ve introduced a variable called “User is admin,” which is set to true for some users and false for others:
Here’s the root of the challenge: In this scenario I want administrators to see all projects, but the initial filtering still displays only those where the user is a participant.
I’ve experimented with “Client Filters,” where I can create a filter based on a variable or another class (see image below). However, to display all data for the admin, I need to check the “Read All Objects” option. This feels a bit unconventional, but I guess that’s what has to be done to be able to display all data for the admin::
This use case can also be related when data in classes for example has a property for a “Responsible Company”. Some users should only see data from their company, but a user from another company might want to see data from multiple companies (not particularly all).
Anyone have any thoughts regarding this?