2020-06-23 05:56:52 -04:00
|
|
|
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
|
|
|
// See LICENSE.txt for license information.
|
|
|
|
|
|
|
|
|
|
package api4
|
|
|
|
|
|
2024-07-15 10:52:03 -04:00
|
|
|
import "net/http"
|
|
|
|
|
|
2020-06-23 05:56:52 -04:00
|
|
|
func (api *API) InitRoleLocal() {
|
2024-07-15 10:52:03 -04:00
|
|
|
api.BaseRoutes.Roles.Handle("", api.APILocal(getAllRoles)).Methods(http.MethodGet)
|
|
|
|
|
api.BaseRoutes.Roles.Handle("/{role_id:[A-Za-z0-9]+}", api.APILocal(getRole)).Methods(http.MethodGet)
|
|
|
|
|
api.BaseRoutes.Roles.Handle("/name/{role_name:[a-z0-9_]+}", api.APILocal(getRoleByName)).Methods(http.MethodGet)
|
|
|
|
|
api.BaseRoutes.Roles.Handle("/names", api.APILocal(getRolesByNames)).Methods(http.MethodPost)
|
|
|
|
|
api.BaseRoutes.Roles.Handle("/{role_id:[A-Za-z0-9]+}/patch", api.APILocal(patchRole)).Methods(http.MethodPut)
|
2020-06-23 05:56:52 -04:00
|
|
|
}
|