A super admin when roles are being used?

Hello friends!
I’m wrestling with the idea of creating an admin interface for our app, however the admin would need access to all the user data. Here’s the thing: I’m already using Roles for another purpose. Does anyone have any ideas on how I could do this?
I was thinking about linking the tables to an entirely different app. Would that work?
Andrew

You can add multiple row owner columns to a table, so if you only have a few admin users, you can add additional columns to your table, set then add row owner columns, and populate them with admin emails.

The other option is a second app that only admins can access, without row owners applied to the tables. It’s probably easiest to duplicate your existing app and make adjustments for admin use instead of starting from scratch.

2 Likes

Do you mean that your Admin users already have some other assigned role?

The admin apps I have built have their own users table which is of course separate to the users table in the public app.
In the admin app the public app users table is there but there is also a second admin users table and access is based on this table and roles.

public app

  • users table with roles (used to to control access and permissions based on role)

admin app

  • users table from public app
  • admin users table with roles

Not sure if that is a good idea or a solution for you, but I’m trying to say that because the admin users table is separate then the roles in your public app aren’t what Glide is looking at for logged in users.

That sounds confusing even to me :rofl: HTH

3 Likes

Yeah. They already have an assigned role.

Jeff,
If I take your method would I simply link the tables?
Andrew

Blairrorani,
I think I understand. Here’s how I picture it: I’d link the users table from App1 to my admin App and create an admin users table with roles so that I’m looking at (and manipulating) the App1 users table but managing access via the Admin users table?
Is that right? :grinning:

Gotcha.
Unfortunately you’ve bumped into a limitation of native Glide tables here. Technically, Glide supports up to 9 roles per user. But the only way to assign more than one role to a user is to use a non-computed array column for your Roles. However, it’s impossible to create a non-computed array column in a native table, and so you are stuck.

One option would be to attach a Google Sheet and use that sheet for your User Profiles, and create a series of columns in the Google Sheet - Role 1, Role 2, Role 3, etc. These columns would appear as an array column in the Data Editor, and because it’s a non-computed array you could configure it as your Role column. End result being that you could have up to 9 roles per user.

I use the above option myself anytime I have a need to assign multiple roles per user.

2 Likes

That’s how I’d do it.

In my example, the users for app 1 are clients who can view their data only in app1.
App 2 has these users in a table.
The users table in app 2 has admin users with admin roles.

Is that what you’re after?

(updated: you should just dupliate app 1 and edit to create app 2 as others have suggested, what I do)

You can add existing tables to a project but you will lose any computed columns you may have. If you duplicate your project then you can choose to have it use the same tables, and you will retain the computed columns. Either way, you can have multiple projects using the same tables.

I also think you could technically use the same user table in both projects, but have separate columns for roles and row owners that are specific to each project. That’s all up to you.

3 Likes

Thanks so much, Jeff! I’ll give it a shot!
Quick question: if you add a new table in “App 1” the duplicated project won’t have that table, correct? I’d have to link it? Is that right?
Andrew

1 Like

That’s correct, yes.

2 Likes

Thanks, Darren!