mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
chore: remove organization_id suffix from org_member roles in database (#13473)
Organization member's table is already scoped to an organization. Rolename should avoid having the org_id appended. Wipes all existing organization role assignments, which should not be used anyway.
This commit is contained in:
@ -68,7 +68,7 @@ func TestExtractUserRoles(t *testing.T) {
|
||||
Roles: orgRoles,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
return user, append(roles, append(orgRoles, rbac.RoleMember(), rbac.RoleOrgMember(org.ID))...), token
|
||||
return user, append(roles, append(orgRoles, rbac.RoleMember(), rbac.ScopedRoleOrgMember(org.ID))...), token
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -89,7 +89,8 @@ func TestExtractUserRoles(t *testing.T) {
|
||||
|
||||
orgRoles := []string{}
|
||||
if i%2 == 0 {
|
||||
orgRoles = append(orgRoles, rbac.RoleOrgAdmin(organization.ID))
|
||||
orgRoles = append(orgRoles, rbac.RoleOrgAdmin())
|
||||
roles = append(roles, rbac.ScopedRoleOrgAdmin(organization.ID))
|
||||
}
|
||||
_, err = db.InsertOrganizationMember(context.Background(), database.InsertOrganizationMemberParams{
|
||||
OrganizationID: organization.ID,
|
||||
@ -99,8 +100,7 @@ func TestExtractUserRoles(t *testing.T) {
|
||||
Roles: orgRoles,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
roles = append(roles, orgRoles...)
|
||||
roles = append(roles, rbac.RoleOrgMember(organization.ID))
|
||||
roles = append(roles, rbac.ScopedRoleOrgMember(organization.ID))
|
||||
}
|
||||
return user, roles, token
|
||||
},
|
||||
|
Reference in New Issue
Block a user