Thanks to visit codestin.com
Credit goes to github.com

Skip to content

chore: Rename 'admin' to 'owner' #3498

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

Merged
merged 11 commits into from
Aug 15, 2022
Merged

chore: Rename 'admin' to 'owner' #3498

merged 11 commits into from
Aug 15, 2022

Conversation

Emyrk
Copy link
Member

@Emyrk Emyrk commented Aug 12, 2022

What this does

Admin -> template-admin and user-admin
First user -> owner

Screenshot from 2022-08-12 16-26-23

@Emyrk Emyrk marked this pull request as draft August 12, 2022 21:30
@Emyrk Emyrk force-pushed the stevenmasley/2135/roles_mig branch from a202178 to fb4f80f Compare August 12, 2022 22:29
@Emyrk Emyrk marked this pull request as ready for review August 15, 2022 15:24
@Emyrk Emyrk requested review from ammario and a team as code owners August 15, 2022 15:24
Copy link
Member

@Kira-Pilot Kira-Pilot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FE ✅

@Emyrk Emyrk requested review from coadler and johnstcn August 15, 2022 16:52
-- Update the first user with the role 'admin'. This should be the first
-- user ever, but if that user was demoted from an admin, then choose
-- the next best user.
id = (SELECT id FROM users WHERE 'admin' = ANY(rbac_roles) ORDER BY created_at ASC LIMIT 1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could technically cause the query to fail if no rows are found, I think doing id IN (...) would allow it to match no rows.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh interesting. Let me try it out

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@coadler It does not seem to matter.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I thought this would've caused an issue when you compared a non-null field to null. Sounds good then!

@Emyrk Emyrk merged commit 01dd35f into main Aug 15, 2022
@Emyrk Emyrk deleted the stevenmasley/2135/roles_mig branch August 15, 2022 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants