@Summary Get role IdP Sync settings by organization @ID get-role-idp-sync-settings-by-organization @Security CoderSessionToken @Produce json @Tags Enterprise @Param organization path string true "Organization ID" format(uuid) @Success 200 {object} codersdk.RoleSyncSettings @Router /api/v2/organizati
(rw http.ResponseWriter, r *http.Request)
| 287 | // @Success 200 {object} codersdk.RoleSyncSettings |
| 288 | // @Router /api/v2/organizations/{organization}/settings/idpsync/roles [get] |
| 289 | func (api *API) roleIDPSyncSettings(rw http.ResponseWriter, r *http.Request) { |
| 290 | ctx := r.Context() |
| 291 | org := httpmw.OrganizationParam(r) |
| 292 | |
| 293 | if !api.Authorize(r, policy.ActionRead, rbac.ResourceIdpsyncSettings.InOrg(org.ID)) { |
| 294 | httpapi.Forbidden(rw) |
| 295 | return |
| 296 | } |
| 297 | |
| 298 | //nolint:gocritic // Requires system context to read runtime config |
| 299 | sysCtx := dbauthz.AsSystemRestricted(ctx) |
| 300 | settings, err := api.IDPSync.RoleSyncSettings(sysCtx, org.ID, api.Database) |
| 301 | if err != nil { |
| 302 | httpapi.InternalServerError(rw, err) |
| 303 | return |
| 304 | } |
| 305 | |
| 306 | httpapi.Write(ctx, rw, http.StatusOK, settings) |
| 307 | } |
| 308 | |
| 309 | // @Summary Update role IdP Sync settings by organization |
| 310 | // @ID update-role-idp-sync-settings-by-organization |
nothing calls this directly
no test coverage detected