github.com/masterhung0112/hk_server/v5@v5.0.0-20220302090640-ec71aef15e1c/api4/role_local.go (about)

     1  // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
     2  // See LICENSE.txt for license information.
     3  
     4  package api4
     5  
     6  func (api *API) InitRoleLocal() {
     7  	api.BaseRoutes.Roles.Handle("/{role_id:[A-Za-z0-9]+}", api.ApiLocal(getRole)).Methods("GET")
     8  	api.BaseRoutes.Roles.Handle("/name/{role_name:[a-z0-9_]+}", api.ApiLocal(getRoleByName)).Methods("GET")
     9  	api.BaseRoutes.Roles.Handle("/names", api.ApiLocal(getRolesByNames)).Methods("POST")
    10  	api.BaseRoutes.Roles.Handle("/{role_id:[A-Za-z0-9]+}/patch", api.ApiLocal(patchRole)).Methods("PUT")
    11  }