коммит произвёл
GitHub
родитель
83006ff8ca
Коммит
d2594e5046
@@ -27,7 +27,8 @@ func (api *API) InitAccessControlPolicy() {
|
||||
|
||||
api.BaseRoutes.AccessControlPolicy.Handle("", api.APISessionRequired(getAccessControlPolicy)).Methods(http.MethodGet)
|
||||
api.BaseRoutes.AccessControlPolicy.Handle("", api.APISessionRequired(deleteAccessControlPolicy)).Methods(http.MethodDelete)
|
||||
api.BaseRoutes.AccessControlPolicy.Handle("/activate", api.APISessionRequired(updateActiveStatus)).Methods(http.MethodGet)
|
||||
api.BaseRoutes.AccessControlPolicy.Handle("/activate", api.APISessionRequired(updateActiveStatusDeprecated)).Methods(http.MethodGet)
|
||||
api.BaseRoutes.AccessControlPolicy.Handle("/activate", api.APISessionRequired(updateActiveStatus)).Methods(http.MethodPost)
|
||||
api.BaseRoutes.AccessControlPolicy.Handle("/assign", api.APISessionRequired(assignAccessPolicy)).Methods(http.MethodPost)
|
||||
api.BaseRoutes.AccessControlPolicy.Handle("/unassign", api.APISessionRequired(unassignAccessPolicy)).Methods(http.MethodDelete)
|
||||
api.BaseRoutes.AccessControlPolicy.Handle("/resources/channels", api.APISessionRequired(getChannelsForAccessControlPolicy)).Methods(http.MethodGet)
|
||||
@@ -232,6 +233,12 @@ func searchAccessControlPolicies(c *Context, w http.ResponseWriter, r *http.Requ
|
||||
}
|
||||
}
|
||||
|
||||
func updateActiveStatusDeprecated(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
// Set deprecation header to inform clients
|
||||
w.Header().Set("Deprecation", "true")
|
||||
c.Err = model.NewAppError("updateActiveStatusDeprecated", "api.access_control_policy.update_active_status.deprecated", nil, "", http.StatusMethodNotAllowed)
|
||||
}
|
||||
|
||||
func updateActiveStatus(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
if !c.App.SessionHasPermissionTo(*c.AppContext.Session(), model.PermissionManageSystem) {
|
||||
c.SetPermissionError(model.PermissionManageSystem)
|
||||
|
||||
@@ -55,6 +55,10 @@
|
||||
"id": "api.access_control_policy.get_fields.limit.app_error",
|
||||
"translation": "Get fields limit is not valid."
|
||||
},
|
||||
{
|
||||
"id": "api.access_control_policy.update_active_status.deprecated",
|
||||
"translation": "This method is deprecated. Please use the POST method instead."
|
||||
},
|
||||
{
|
||||
"id": "api.acknowledgement.delete.archived_channel.app_error",
|
||||
"translation": "You cannot remove an acknowledgment in an archived channel."
|
||||
|
||||
Ссылка в новой задаче
Block a user