I cannot seem to write to the Role column in an app I’m working on.
I can write to the column from the data editor. I cannot get the front end GUI to write to this column. The GUI can change every other column (name, email, etc.) but writing to the Role column is not sticking. It acts like it writes to the column and then the data is lost within a few minutes or on a refresh.
I am using a Helper Table with role titles. I’ve also tried directly typing in the role title to a text entry field. Neither option sticks.
Several of my apps are set up the same way - with a user manager GUI that Admin users can access and add/change info about other users. The same setup works in every other app I have. Sometimes I use Row Owners, sometimes I don’t (depends on the need). That doesn’t seem to have any impact here.
Anyone have ideas on how to solve this issue? Or am I hitting some sort of bug?
Thanks for any help out there!
Here’s a GIF of what I’m seeing. I changed the name of the user to show how I can edit/write to the NAME column. I refresh the screen to show how the ROLE is lost. I’m in the Glide builder in the screenshot, but the behavior is the same in the live app in multiple browsers.
This is documented and expected behaviour. You cannot set user roles via the user interface.
The only way to do it other than directly in the Data Editor is to use the API.
Unfortunately, that’s not exactly correct in this case. My role column is functionally the same as any text column. For instance, I just changed the “bad” column to a different name. Made a new column called Role. I’m able to use the user interface to change that new role column without a problem. The old “role” column is now called CUCUMBER (random word) and I still can’t writ to it from the user interface.
Additionally, I’m able to do the same in many other apps (both with row owners and without). I don’t think this is a “works as intended” issue.
Yeah but did you also change the user profile configuration when you created a new role column to point the role at that new column?
A role column is very different from other columns once the user profile configuration is set to use that column as a role. Just changing the column name to “Role” does not make it a role column. The user profile configuration determines that.
Because as @Darren_Murphy pointed out…and as it’s well documented…you can’t change a column designated as a Role column from the app. It’s like that for security reasons.
Naming a column “Role” does for make it a Role column in the sense we are talking about. Role functionality in Glide is used to allow the ability to assign roles as row owners instead of emails.
Right, got it. Thanks for that. Totally forgot about that over in settings > users & authentication… thanks for helping me learn!
I guess I usually don’t use a true “role” column in the user profile sense. I’m just using a text column with job titles/functions and using that to build filter conditions.
My fix in this case was to just tell the app there are no roles, but still use a column called “role” to create conditional views.
This won’t work on every app, I’m sure… but works in this case.
It’s a little surprising that you cannot set it up for your client to manage their users. Kind of hard to hand off an app to a client if they can’t manage their own users!
Yeah, I’m not completely sure what the reasoning is behind it. I don’t know if it’s a technical limitation, or if it opens up some kind of vulnerability if a user is allowed to change the Role. However, you should be able to add a new user row from the app and assign a role at the time the row is added, but you can only assign a role you possess yourself. For example, an admin can only assign an admin role and a user can only assign a user role if they are allowed to add user rows.
I agree that it’s a bit restrictive, but it’s been that way since Roles were first introduced.
As for using pseudo roles, that is common practice, but you cannot use them as row owners, so it does not provide the same data security and isolation that using row owners would provide.
Good info. Fortunately, this app doesn’t need any sort of data isolation.
I’ve only ever used emails as row owners, but was only vaguely aware you could have some sort of role own everyone’s rows. I’ll have to play around with that to sharpen some skills. I need to work on a better onboarding flow, too. But at least this app is solved for now. Thanks again for your help.