mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
feat: Implied 'member' roles for site and organization (#1917)
* feat: Member roles are implied and never exlpicitly added * Rename "GetAllUserRoles" to "GetAuthorizationRoles" * feat: Add migration to remove implied roles * rename user auth role middleware
This commit is contained in:
11
coderd/database/migrations/000016_drop_member_roles.down.sql
Normal file
11
coderd/database/migrations/000016_drop_member_roles.down.sql
Normal file
@ -0,0 +1,11 @@
|
||||
--- Remove the now implied 'member' role.
|
||||
UPDATE
|
||||
users
|
||||
SET
|
||||
rbac_roles = array_append(rbac_roles, 'member');
|
||||
|
||||
--- Remove the now implied 'organization-member' role.
|
||||
UPDATE
|
||||
organization_members
|
||||
SET
|
||||
roles = array_append(roles, 'organization-member:'||organization_id::text);
|
11
coderd/database/migrations/000016_drop_member_roles.up.sql
Normal file
11
coderd/database/migrations/000016_drop_member_roles.up.sql
Normal file
@ -0,0 +1,11 @@
|
||||
--- Remove the now implied 'member' role.
|
||||
UPDATE
|
||||
users
|
||||
SET
|
||||
rbac_roles = array_remove(rbac_roles, 'member');
|
||||
|
||||
--- Remove the now implied 'organization-member' role.
|
||||
UPDATE
|
||||
organization_members
|
||||
SET
|
||||
roles = array_remove(roles, 'organization-member:'||organization_id::text);
|
Reference in New Issue
Block a user