Skip to content
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

Add default role to users table and make roles enum #316

Closed
maxachis opened this issue Jun 1, 2024 · 3 comments
Closed

Add default role to users table and make roles enum #316

maxachis opened this issue Jun 1, 2024 · 3 comments
Labels

Comments

@maxachis
Copy link
Contributor

maxachis commented Jun 1, 2024

Currently, in the users table in the database, roles are either "admin" or null. This forces the middleware logic to make assumptions as to what kind of role a user has, typically defaulting to "user". When adding users, we should probably make sure their role is set to a default value of "user", rather than null.

Additionally, we may want to ensure the roles are limited only to a set of enums. Currently, the only enums would be "admin", "user", but this could conceivably expand in the future.

@maxachis
Copy link
Contributor Author

maxachis commented Jun 17, 2024

Created a dev script update to this, but will need to complement with a web app update which is to be merged at the same time.

@josh-chamberlain
Copy link
Contributor

josh-chamberlain commented Jun 17, 2024

I think we'd deprecate the roles concept when we close #162—we could have an admin boolean flag for users instead of roles.

@maxachis
Copy link
Contributor Author

Josh is right! This issue can thus be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants