We use cookies to improve our service. Learn more.

Reference / Security and User Data

Roles

Define roles for your users and build different expereriences and permissions for those groups.

Creating roles allows you to have tighter control over what different users can see and do in your app. You can assign roles to users in your User Profiles table. You can then use these roles with Row Owner columns to make certain records only accessible to certain users.

This allows you to, for example, give many people the role of 'Admin' and then make 'Admin' a Row Owner for certain rows. Now, only people with the role of Admin will be able to access those rows.

Does my app need roles?

If each of your rows has only one owner, then you can just use a single column with the emails and make that a Row Owner column.

Row Owners
Row Owners

If you need more than 1 person to own a row, you could use an Array Column as a Row Owner column. Note that if you use this approach, every time you need to give more people access to a row, you will need to add another column to your array.

A much better way of assigning multiple owners to rows is through the use of roles.

Set up

Roles are defined in your User Profiles configuration. To configure the Role column for your App, go to Settings, select Users & authentication, and click on Edit User Profiles.

Choose the column you want to use as the Role column.

A role can be any kind of text string, so long as it's not an email address. You can choose a single column for your role column, or an Array Column – and have multiple roles per user.

Role 1Role 2Role 3Role 4
AdminEditorManagerMarketing

Computed Columns

You cannot at the moment use Computed Columns as Roles. Roles have to be manually entered in Basic Columns.

Row owners & roles

You can use Roles in lots of ways, but one of the most important is securing data with Row Owners.

In the image below you can see that we've added the name of the role in the Row Owners column. This means that anyone who is assigned the role in that row will have access to that row.

As you can see, you can have emails or roles in this column 👆🏼. If you make an Array Column or a Row Owner column, you can have emails and roles assigned to the same row. For example:

Array Column & Row Owners
Array Column & Row Owners

Read more about Array Columns here, but below is the way this looks in the sheet.

Changing Roles

At the moment, you cannot change somebody's role via the app. A role can only be changed via the sheet or Data Editor. If you show the Roles column in the app somewhere, users will be able to change the value - but this will not affect the backend and you will see the value change back.

Securing new items

If you let your users add items then you may want to automatically secure the row that gets added and make it accessible only to people with the same role as the person who added it.

This is possible with the use of User Profile Columns.

Setting roles within the app

You can allow users of your apps to set the role of new users that they add. However, they can only be assigned roles that the adding user has.

For example, if a user who has the role of Admin & Editor and adds a new user to the app – they can only assign that new user the role of Admin or Editor.

Therefore, if you want users in your app to be able to assign all role-types – then they need to be given all role-types themselves.

Assigning Roles
Assigning Roles
Updated 2 weeks ago
Was this helpful?