mirror of
https://github.com/coder/coder.git
synced 2025-07-06 15:41:45 +00:00
chore: implement api for creating custom roles (#13298)
api endpoint (gated by experiment) to create custom_roles
This commit is contained in:
@ -326,6 +326,23 @@ func New(ctx context.Context, options *Options) (_ *API, err error) {
|
||||
r.Put("/", api.putAppearance)
|
||||
})
|
||||
})
|
||||
|
||||
r.Route("/users/roles", func(r chi.Router) {
|
||||
r.Use(
|
||||
apiKeyMiddleware,
|
||||
)
|
||||
r.Group(func(r chi.Router) {
|
||||
r.Use(
|
||||
api.customRolesEnabledMW,
|
||||
)
|
||||
r.Patch("/", api.patchRole)
|
||||
})
|
||||
// Unfortunate, but this r.Route overrides the AGPL roles route.
|
||||
// The AGPL does not have the entitlements to block the licensed
|
||||
// routes, so we need to duplicate the AGPL here.
|
||||
r.Get("/", api.AGPL.AssignableSiteRoles)
|
||||
})
|
||||
|
||||
r.Route("/users/{user}/quiet-hours", func(r chi.Router) {
|
||||
r.Use(
|
||||
api.autostopRequirementEnabledMW,
|
||||
|
Reference in New Issue
Block a user