-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reworking user roles grant and admin #491
Comments
Thanks, we will take a look. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Any progress on that matter? I still run into issues here Because i can't configure the available roles and default assigned roles separately |
You can do it today. The proposed changes here are purely UX improvements (much needed to be fair) but functionality-wise it doesn't add anything new. Basically the way it works today:
|
The main problem is, that the role is not listed in the User Configuration when it's not in the list of Available roles (altough it's in the table roles)... But when it's in the list, it will be added by default to the user. I know that it can fix that all via the database.. but my client can not, and they are using the Auth UI to set roles for their users. |
Ok, that's a bug in the dashboard then. We are probably fetching the data from the wrong place so that needs fixing. |
I created an issue that we will be prioritizing to fix the aforementioned bug. nhost/nhost#3166 |
I think this issue is mostly solved as I think this issue was mostly due to a confusion introduce by a bug in the dashboard. The way it works is as follows: [auth.user.roles]
allowed = [ "user", "me" ] This config basically says that a user can request the roles "user" and "me" during sign up. If the user doesn't request anything we automatically assign all. Now, the issue was that the dashboard was then using this same "allowed" setting to show which roles a user can be assigned when editing them, which was NOT correct. The dashaboard should've been querying I am closing the issue but feel free to reopen if anyone thinks this issue is not yet solved. |
Context: in nhost.toml, standard config for roles.allowed:
When roles.allowed includes other roles, such as moderator. "allowed" implies a list that could be granted to users. But no, current behaviour is that any on this list is auto granted to all new users. This is misleading and dangerous, when additional roles is associated with higher permissions, and thus should be only allowed but require explicit (manual) grant to select users.
I suggest reworking this for both nhost.toml and dashboard /users, ex.
Allowed Roles here should instead be a new config for "Granted Roles". Where it list all roles in the auth.roles table, with select toggles on as per what's been granted under the auth.user_roles table.
And then, in dashboard /settings/roles-and-permissions
This actual Allowed Roles list should be just a CRUD interface to config the auth.roles table. Could even just link out to dashboard /database/browser/default/auth/roles
With above, auth.user.roles.allowed in nhost.toml should be deprecated. Grant is per
user_roles
, and Allowed is all rows inroles
tablesThe text was updated successfully, but these errors were encountered: