diff --git a/api-tests/core/admin/admin-permission.test.api.js b/api-tests/core/admin/admin-permission.test.api.js index e1df822ade..f6c5e15d26 100644 --- a/api-tests/core/admin/admin-permission.test.api.js +++ b/api-tests/core/admin/admin-permission.test.api.js @@ -373,6 +373,12 @@ describe('Role CRUD End to End', () => { "displayName": "Update", "subCategory": "options", }, + { + "action": "admin::review-workflows.create", + "category": "review workflows", + "displayName": "Create", + "subCategory": "options", + }, { "action": "admin::review-workflows.read", "category": "review workflows", diff --git a/packages/core/admin/ee/server/services/review-workflows/workflows.js b/packages/core/admin/ee/server/services/review-workflows/workflows.js index be47da853b..12b4831686 100644 --- a/packages/core/admin/ee/server/services/review-workflows/workflows.js +++ b/packages/core/admin/ee/server/services/review-workflows/workflows.js @@ -1,7 +1,7 @@ 'use strict'; const { set } = require('lodash/fp'); -const { ApplicationError } = require('@strapi/utils').errors; +const { ValidationError } = require('@strapi/utils').errors; const { WORKFLOW_MODEL_UID } = require('../../constants/workflows'); const { getService } = require('../../utils'); @@ -16,7 +16,7 @@ module.exports = ({ strapi }) => ({ async create(opts) { if (!opts.data.stages) { - throw new ApplicationError('Can not create a workflow without stages'); + throw new ValidationError('Can not create a workflow without stages'); } const stageIds = await getService('stages', { strapi })