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');
|
2021-08-23 22:41:22 +02:00
|
|
|
|
|
|
|
const SSO_ACTIONS = [
|
|
|
|
{
|
|
|
|
uid: 'provider-login.read',
|
|
|
|
displayName: 'Read',
|
|
|
|
pluginName: 'admin',
|
|
|
|
section: 'settings',
|
|
|
|
category: 'single sign on',
|
|
|
|
subCategory: 'options',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
uid: 'provider-login.update',
|
|
|
|
displayName: 'Update',
|
|
|
|
pluginName: 'admin',
|
|
|
|
section: 'settings',
|
|
|
|
category: 'single sign on',
|
|
|
|
subCategory: 'options',
|
|
|
|
},
|
|
|
|
];
|
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')) {
|
2021-08-23 22:41:22 +02:00
|
|
|
await actionProvider.registerMany(SSO_ACTIONS);
|
2021-01-27 11:52:02 +01:00
|
|
|
}
|
2020-12-21 17:11:48 +01:00
|
|
|
|
|
|
|
await executeCEBootstrap();
|
|
|
|
};
|