Array Column as Row Owner

I am trying to follow some of the documentation around setting an array column as a row owner field but it’s giving me a little bit of trouble. Here’s a quick video about it, Loom | Free Screen & Video Recording Software | Loom.

Essentially here’s what I was to do.

  • Clients should be able to create/view/edit only their own tasks.
  • Admins should be able to see all clients tasks and create/edit/update/etc their tasks.

I’m trying to do this with security in mind, e.g. I don’t want the app to download Client B’s tasks (and not display them) when Client A is looking at the task list.

Thanks for the help!

1 Like

Yeah, computed columns cannot be row owners. This is because computed columns are only “computed” after data is downloaded to a users device. And at that point, it is too late to apply row owners.

In your example, it looks like your Owner 2 column is a template column. If you make that a basic text column, you should then be able to make it a row owner.

In the example in the docs you are referring to, the array column actually comes from an attached Google Sheet. When you name columns (in a Google Sheet) in a sequence as something like Owner 1, Owner 2, etc, Glide will automatically convert them to an array column. In this case, they are not considered as a computed column, so row owners can be applied. That part of the docs probably needs updating.

1 Like

Keep in mind that you can assign multiple basic columns in a table as row owner columns, so creating an array may not be necessary.

2 Likes

Thanks Darren and Jeff – Super helpful.

I was able to get past the multiple row owners piece.

One other quick question. It looks like there was an update to Glide Pages recently and so I’m still a little hazy on if I should be filtering (mainly because of the big security warning that comes up).

Ultimately, what I’m shooting for is the ability to protect tasks so that only the client that created it and the admin (role) can see it.

I realized after I fixed the multiple row owner columns, it looks like I still need to filter data in the collection, but with the security message that pops up, I’m a little confused at how I do it the proper way so that someone that’s looking through dev tools / console, doesn’t get another client’s task/project data.

Hopefully that makes sense. Thanks!

Filtering just hides data from view. The security aspect is that a filter is applied to data that has already been downloaded to a user’s decice. Row Owners prevents unowned rows from being downloaded in the first place. If you have applied rows owners to your table and you are still seeing unowned data, then that’s a big problem, or something still isn’t configured correctly.

At the very least, I would refresh your browser to see if that makes a difference.

Ok I’ve been searching the forums and still coming up confused with how Glide Tables and Row Owners and Roles work.

I came across this thread: Assign Multiple Row Owner Columns - #7 by Robert_Petitto, that had a couple of mentions that lead me to believe that Glide Tables is not the right place to store the data yet for me.

Specifically, two comments (7 & 9) spoke to me in the thread. (Sorry, new users can only post two links, so I had to give you the numbers instead)

But figured I’d put together a quick video explaining what I’ve tried and how I’m trying to accomplish.

Thank you for all of your help so far. I think I’m close to getting what I’m trying to accomplish, just not confident yet that I’m in the right place.

Thank you for the video, that was very helpful.

First of all, I want to mention that how you had your Projects table with an Email column as well as a Role column both set up as row owners looks correct to me. I think it did in fact have that set up correctly. So the first thing I would do is add the Role column back to that table, fill it with ‘Admin’, and make it a row owner column. In regards to that process, I see no reason why you would have to consider using google sheets over glide tables.

However, in your User table, I think you have a little bit of confusion between Row Owners and Roles. They have separate, but complimentary functions. At 2:45 in your video you show how you set up your user profiles. Everything looks to be set up correctly. The email column is the email of the signed in user, and the role column is the role that has been assigned to that user. But, in your user table you have assigned Row Owners to both the Email column and the Role column. Having the email column as a row owner is good. That means that the user that is signed in will only have access to their own user row because the email that they signed in with will match the email in only their own row. However, you have also set your Role column as a row owner. In reality, what you have done is not only assign a role to a user, but you have also granted row owner access to all other rows that have that same assigned role. By doing that, you have granted anybody with a Client role to have access to any other User table row that has a row owner column that contain ‘Client’. Ideally you would have a Role column for the purpose of setting up the Role value in the user profile, but you would also have another Role column (or maybe ‘Admin Role’) that would be populated with only ‘Admin’. That ‘Admin Role’ column would be what becomes a row owner column. So in the end, in the User table, instead of granting Clients access to all other Client user rows and Admins access to all Admin user rows…instead Clients will only have access to their own row because they are not an Admin, which would match the value in the AdminRole row owner column, but they will have access to their own row because of the email row owner column. As for Admins, they will have access to every row because their Role is Admin and every AdminRole value is Admin.
TLDR: Remove row owners from your Role column. Then create a second role column, name it ‘Admin Role’ and fill it with Admin, then set that as your row owner column. Leave the user profile settings as is.

Now, I don’t know if the above is the source of your problem in the Projects table or not, but I would at least start there. The way you initially showed your Projects table with a Role column assigned as a row owner column, did look correct.

Once you’ve corrected your User table, then try the same tests that you did before. On the surface, it possibly looks like a bug, but I know things can get weirded out when adding and removing row owners and when switching user views. Normally I’m more concerned about what the app interface editor shows regarding row owners as opposed to what the data editor shows. Things get weird in the data editor, because all data is still there, unlike the reduced set of owned rows that you would get in the app. The app interface editor is usually more accurate in respecting row owners. So usually if the app is doing what it’s supposed to do, then it’s less of a concern what the data editor is doing.

Keep in mind that glide has been going through some major changes in it’s underlying code. This is not normal for glide, but their old code wasn’t as flexible to allow growth and enhancements. This is a good change in the long run, but it has some growing pains as they work out some bugs.

(I was going to add one more thing, but I forgot. If I remember, I’ll add another post.)

2 Likes

Just to complement Jeff’s reply, you might find the below post informative.
In the screen shots in the below post, pay careful attention to which columns have row owners applied (little purple person icon).

2 Likes

Oh, that post reminded me of the last thing I was going to mention. @ajmorris you have Client roles assigned to users who are not admins. Unless you will ever need to use a row owner of Client anywhere else in your app, I would just make those blank. @Darren_Murphy correct me if I’m wrong, but it’s my assumption that those users with a Client role will be regarded as Private users because they have a role assigned. Is it true that if it’s blank, then they will be considered public users??? Or does the fact that Roles are used at all make every user a Private user? @ajmorris This is something to consider because your limits for Private users is much less than the limits for Public users.

2 Likes

Your assumption is correct - only users with roles assigned will be considered as private users - BUT, it does also depend on the Privacy settings. If you are restricting who can sign in, then the app/page is essentially private, and all users will be counted as private users, regardless of any role allocations.

Edit: Just want to clarify that when I say all users are counted as private users, I do of course mean all signed in users. You could still have users that never sign in, and these would count as public users.

2 Likes

Got it. Thanks for clarifying.

Here’s screenshots of my tables for reference.


I’ve tried in both Safari and Chrome to see if it might be browser specific. It doesn’t appear to be.

If we assume that my tables from those screenshots are setup correctly, I would assume to see the UI interface to reflect what we’re expecting. I’m still not seeing that. Here’s a quick video for just that.

You’re close, but not quite there. Looks like you’re still getting a little confused when it comes to the difference between Roles & Row Owners.

Here’s a general rule of thumb: a Role column should never have Row Owners applied to it.
And here is another one: Roles are applied to users, not to things.

In your Projects table, you have a column called Role, which doesn’t make sense because you would never assign a Role to a Project. In reality, what that is is an “Owner” column, so I would encourage you to name it as that. Other than that, it’s fine - you have Admin on each row, so anyone with an Admin role would get to see all rows.

In your users table you have Admin Role & Role, which is kind of confusing. What you need is:

  • a Role column, which will be the one defined in your User Profiles config. This column should not have Row Owners applied
  • an Owner column (you can call it anything you like, but owner makes sense). This one should have row owners applied

Now the Role column should contain the role of each specific user. And as previously mentioned, you can leave this blank if users have no role.

But the Owner column - the one you currently have labeled as Admin Role - would normally have an entry in every row. So in your case, you need the word Admin in every row. This will allow any user with an Admin user role (in this case, just you) to see every other users data.

2 Likes

Two things that are still wrong.

This entire column should have Admin placed in it. Only the original Role column should have Admin in the last row.
image

Your original Role column should still be the role for the user profile settings.

image

1 Like

There might still be a bug in the builder. Like I said, the data editor and app editor get weird when you change row owners and switch users. In reality, that won’t happen with the published version. When a user signs into the published app, they are not switching users like that. So, you may not run into issues like that in the published version.

For what it’s worth, it may be worth reporting this behavior to glide support.
https://share.hsforms.com/16jL7NgZYSsW9DinHwTIqZAbvbdc

Thank you, thank you, thank you! Thank you both so much for the help.

I made the changes to the column names and roles and row owners. Those were good suggested changes and I do agree that I was a little confused a bit.

All that said, I was still getting issues within the Glide Editor, so I figured I’d create two “real” users with real emails. I then login via private browsers with both of those accounts to test what @Jeff_Hager was suggesting and I can confirm that everything within the app like he said is not working. Thank you both!!

Interestingly enough, this was exactly how I had it setup before trying a number of other things (Thankfully, I duplicated my app, so I went back to the original to check my row owners and roles).

That said – I did file a support ticket with Glide Support, but was told to come here as they didn’t offer me support on the free plan (This is on a free plan until I’ve finished building it out).

Is there someone here that’s on the support team that could go in and reference that ticket to this thread in order to hopefully confirm and address the bug (if that’s what’s happening)?

3 Likes

@SantiagoPerez

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.