mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat(coderd/rbac): make organization-member a per-org system custom role (#21359)
Migrated the built-in organization-member role to DB storage so it can be customized per org. Closes https://github.com/coder/internal/issues/1073 (part 1)
This commit is contained in:
+7
-5
@@ -34,8 +34,9 @@ func (api *API) AssignableSiteRoles(rw http.ResponseWriter, r *http.Request) {
|
||||
dbCustomRoles, err := api.Database.CustomRoles(ctx, database.CustomRolesParams{
|
||||
LookupRoles: nil,
|
||||
// Only site wide custom roles to be included
|
||||
ExcludeOrgRoles: true,
|
||||
OrganizationID: uuid.Nil,
|
||||
ExcludeOrgRoles: true,
|
||||
OrganizationID: uuid.Nil,
|
||||
IncludeSystemRoles: false,
|
||||
})
|
||||
if err != nil {
|
||||
httpapi.InternalServerError(rw, err)
|
||||
@@ -67,9 +68,10 @@ func (api *API) assignableOrgRoles(rw http.ResponseWriter, r *http.Request) {
|
||||
|
||||
roles := rbac.OrganizationRoles(organization.ID)
|
||||
dbCustomRoles, err := api.Database.CustomRoles(ctx, database.CustomRolesParams{
|
||||
LookupRoles: nil,
|
||||
ExcludeOrgRoles: false,
|
||||
OrganizationID: organization.ID,
|
||||
LookupRoles: nil,
|
||||
ExcludeOrgRoles: false,
|
||||
OrganizationID: organization.ID,
|
||||
IncludeSystemRoles: false,
|
||||
})
|
||||
if err != nil {
|
||||
httpapi.InternalServerError(rw, err)
|
||||
|
||||
Reference in New Issue
Block a user