2020-12-21 17:11:48 +01:00
|
|
|
'use strict';
|
|
|
|
|
2021-02-02 12:27:24 +01:00
|
|
|
// eslint-disable-next-line node/no-extraneous-require
|
2021-04-29 13:51:12 +02:00
|
|
|
const { features } = require('@strapi/strapi/lib/utils/ee');
|
2021-08-23 22:25:31 +02:00
|
|
|
const executeCEBootstrap = require('../../server/bootstrap');
|
|
|
|
const { getService } = require('../../server/utils');
|
2023-01-02 10:08:16 +01:00
|
|
|
const actions = require('./config/admin-actions');
|
2023-03-17 13:31:55 +00:00
|
|
|
const { persistTablesWithPrefix } = require('./utils/persisted-tables');
|
2020-12-21 17:11:48 +01:00
|
|
|
|
|
|
|
module.exports = async () => {
|
2021-03-25 14:59:44 +01:00
|
|
|
const { actionProvider } = getService('permission');
|
|
|
|
|
2021-01-27 11:52:02 +01:00
|
|
|
if (features.isEnabled('sso')) {
|
2023-01-02 10:08:16 +01:00
|
|
|
await actionProvider.registerMany(actions.sso);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (features.isEnabled('audit-logs')) {
|
2023-03-17 13:31:55 +00:00
|
|
|
await persistTablesWithPrefix('strapi_audit_logs');
|
2023-03-09 16:50:51 +00:00
|
|
|
|
2023-01-02 10:08:16 +01:00
|
|
|
await actionProvider.registerMany(actions.auditLogs);
|
2021-01-27 11:52:02 +01:00
|
|
|
}
|
2020-12-21 17:11:48 +01:00
|
|
|
|
2023-01-27 18:30:29 +01:00
|
|
|
if (features.isEnabled('review-workflows')) {
|
2023-03-17 15:23:11 +00:00
|
|
|
// Decorate the entity service with review workflow logic
|
|
|
|
const { decorator } = getService('review-workflows-decorator');
|
|
|
|
strapi.entityService.decorate(decorator);
|
|
|
|
|
2023-01-27 18:30:29 +01:00
|
|
|
const { bootstrap: rwBootstrap } = getService('review-workflows');
|
|
|
|
|
|
|
|
await rwBootstrap();
|
2023-02-10 17:14:41 +01:00
|
|
|
await actionProvider.registerMany(actions.reviewWorkflows);
|
2023-01-27 18:30:29 +01:00
|
|
|
}
|
|
|
|
|
2023-02-24 18:55:55 +01:00
|
|
|
await getService('seat-enforcement').seatEnforcementWorkflow();
|
2023-01-29 19:24:55 +02:00
|
|
|
|
2020-12-21 17:11:48 +01:00
|
|
|
await executeCEBootstrap();
|
|
|
|
};
|