mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: Rename 'admin' to 'owner' (#3498)
Co-authored-by: Colin Adler <colin1adler@gmail.com>
This commit is contained in:
co-authored by
Colin Adler
parent
2306d2c709
commit
01dd35f1ba
@@ -0,0 +1,22 @@
|
||||
UPDATE
|
||||
users
|
||||
SET
|
||||
-- Replace 'template-admin' and 'user-admin' role with 'admin'
|
||||
rbac_roles = array_append(
|
||||
array_remove(
|
||||
array_remove(rbac_roles, 'template-admin'),
|
||||
'user-admin'
|
||||
), 'admin')
|
||||
WHERE
|
||||
-- Only on existing admins. If they have either role, make them an admin
|
||||
ARRAY ['template-admin', 'user-admin'] && rbac_roles;
|
||||
|
||||
|
||||
UPDATE
|
||||
users
|
||||
SET
|
||||
-- Replace 'owner' with 'admin'
|
||||
rbac_roles = array_replace(rbac_roles, 'owner', 'admin')
|
||||
WHERE
|
||||
-- Only on the owner
|
||||
'owner' = ANY(rbac_roles);
|
||||
Reference in New Issue
Block a user