Assign Multiple Roles in Glide Tables

How do I assign a user multiple Roles within Glide tables? Without the array column of Google sheets, how do I add roles without making it seem as though a person has one role called “Role 1, Role 2, Role 3”?

Array column is not necessary. You could assign multiple single columns to be row owners. (Arrays only help now to keep our data nice and neat)

Thanks for helping, @Eric_Penn! I would need to make a separate column for every potential role, then, correct?

Oh, I think I see the difference in your answer and what I asked.

I am trying to assign a single user multiple Roles in the app. So in their User Profile, the Role column would list two or more roles, not just one.

I don’t know how to allow that single Role column to list multiple separate roles for one user.

1 Like

Correct. The advantage here is you could name them each something specific and that should help when using them in relations, filters, etc…

I often try to use an array where it makes sense but other times I use multiple columns for naming/ search purposes.

A user can only have one role as far as I’m aware. One thing you could try is having two roles that are similar in name.

I.e. Admin and AdminPro

Then use ‘includes’ in your filters. So for example show component when Role1 includes Admin. Both Admin and AdminPro could see that component.

I hope this helps!

I am trying to follow this example from the Glide docs. I am guessing that this is only possible if using Google sheets as the data source. Thanks for your help

The only time you should need multiple roles in the user profile sheet would be if you intend to assign other roles to other users using the app. Otherwise you should be fine with a single role in the user profile table, but instead have multiple row owner columns in all of your other data tables.

1 Like

Yes, that’s part of the use case. Can I do it in Glide tables?

Which part? As @Eric_Penn indicated above, yes you can have multiple row owners in a glide table.

Now, this is all assuming that you are trying to achieve true Row Owner data security. If all you are trying to do is control who has editing access to a row or not, you don’t necessarily need to use the user profile role for this. Conditions can check any column in the user profile.

It might help to understand what you ultimate goal is, to see if you are using the correct approach.

1 Like

Thanks, @Jeff_Hager

I am creating a multitenancy app. I need to make sure that only those belonging to a certain department within an institution have access to that department’s data. So, I am using a department code as the Role. However, some people belong to more than one department, or need to view (but perhaps not edit) data from another department.

What I’d like to do is use the Role column to allow some people to belong to more than one department. Then, I am using filters/visibility conditions to give people the ability to edit/add/delete data from only the department(s) to which they belong.

Does that make sense?

Ok. It seems that you are heading in the right direction for your use case. Unfortunately, I think your only option is to create a user profile table in a google sheet, which would allow you to create an array column using the sheet. That would be the only way that you could assign multiple roles to a user, since the user profile functionality only allows one column for Role based security.

2 Likes

Hey Master @Jeff_Hager ,

How to use this is Airtable? “Multiple user can have up to 9 roles”?
I intended that some users could have 3-5 roles. TIA!

image

In AT, you can define the Roles in a Multiple Choice field. This will create an array column on Glides end. Use that array column ad the source for the “Role” field.

3 Likes