Skip to content

Commit

Permalink
Get features from the licenseInfo for the default type mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandrebodin authored and fdel-car committed Jan 25, 2023
1 parent 401d3e1 commit 9211620
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/core/strapi/ee/index.js
Expand Up @@ -15,7 +15,7 @@ const noLog = {
};

const internals = {};
const features = {
const defaultFeatures = {
bronze: [],
silver: [],
gold: ['sso'],
Expand Down Expand Up @@ -97,14 +97,18 @@ Object.defineProperty(module.exports, 'isEE', {

Object.defineProperty(module.exports, 'features', {
get() {
const licenseInfo = module.exports.licenseInfo;

const { type: licenseType } = module.exports.licenseInfo;

const features = licenseInfo.features || defaultFeatures[licenseType];

return {
isEnabled(feature) {
return features[licenseType].includes(feature);
return features.includes(feature);
},
getEnabled() {
return features[licenseType];
return features;
},
};
},
Expand Down

0 comments on commit 9211620

Please sign in to comment.