Data Restriction
Last updated
Last updated
This document details how to manage your database restriction so that you can control what pages/items a logged-in user can access. For example, User A would see only the items they are assigned to and not anyone else's items.
To limit data based on a logged-in user, you need to first make the app private. Check out how to do so here, Private apps.
Once your app is private, please follow these steps:
Go to the "Users" tab in the left sidebar of your app builder.
Under the "Data Restriction" section, click on "Add Restriction" next to the database whose data you want to limit.
In the "Add Restriction" popup, select the "Restriction Method" from either a "Match Relation to Users Database" (a relation linked to your Users' database) or "Match Property to Users Database".
Select the property based on whose data you'd like to match with the logged-in user.
Click on "Confirm"
Publish the app
Now when a user logs in to the app, they will see only those pages/items of the database where their data restriction property matches OR their data is linked in the user relation property.
Data Restriction works on a database level for the whole application. However, there are use cases where you'd want to disable the data restriction on certain screens or components. For example, in a Project Tracker app, your Users database might be restricted to ensure every user can see only their profile. However, the users should be able to see the name/details of the other users on the Projects screen.
To selectively disable data restriction on some screens/components,
Locate the "Data Restriction" section on your list screen or list components.
Disable the "Enabled for this screen/list" toggle.
When you disable the data restriction for a particular screen/component, the application will receive all the data/rows corresponding to the database.