[MM-54288] Support Packet V2 (#29403)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
091d1bba8b
Коммит
8d4bf4bae0
@@ -90,6 +90,20 @@ func (a *App) GetRolesByNames(names []string) ([]*model.Role, *model.AppError) {
|
||||
return roles, nil
|
||||
}
|
||||
|
||||
func (a *App) DeleteRole(id string) (*model.Role, *model.AppError) {
|
||||
role, err := a.Srv().Store().Role().Delete(id)
|
||||
if err != nil {
|
||||
var nfErr *store.ErrNotFound
|
||||
switch {
|
||||
case errors.As(err, &nfErr):
|
||||
return nil, model.NewAppError("DeleteRole", "app.role.get.app_error", nil, "", http.StatusNotFound).Wrap(err)
|
||||
default:
|
||||
return nil, model.NewAppError("DeleteRole", "app.role.delete.app_error", nil, "", http.StatusInternalServerError).Wrap(err)
|
||||
}
|
||||
}
|
||||
return role, nil
|
||||
}
|
||||
|
||||
// mergeChannelHigherScopedPermissions updates the permissions based on the role type, whether the permission is
|
||||
// moderated, and the value of the permission on the higher-scoped scheme.
|
||||
func (s *Server) mergeChannelHigherScopedPermissions(roles []*model.Role) *model.AppError {
|
||||
|
||||
Ссылка в новой задаче
Block a user