芝麻web文件管理V1.00
编辑当前文件:/home/freeclou/app.optimyar.com/backend/node_modules/strapi-admin/ee/services/role.js
'use strict'; const { toString } = require('lodash/fp'); const ssoCheckRolesIdForDeletion = async ids => { const adminStore = await strapi.store({ type: 'core', environment: '', name: 'admin' }); const { providers: { defaultRole }, } = await adminStore.get({ key: 'auth' }); for (const roleId of ids) { if (defaultRole && toString(defaultRole) === toString(roleId)) { throw new Error( 'This role is used as the default SSO role. Make sure to change this configuration before deleting the role' ); } } }; module.exports = { ssoCheckRolesIdForDeletion, };