Merge pull request #15137 from overleaf/ab-managed-users-professional-plan

[web] Restrict managed users eligibility to professional group plans

GitOrigin-RevId: 29b20067858d3aac9a17f5c78defc05d04d29bda
This commit is contained in:
Alexandre Bourdin 2023-10-06 10:59:59 +02:00 committed by Copybot
parent 7268e0f0aa
commit 06e57bce87

View file

@ -0,0 +1,15 @@
const FeaturesHelper = require('./FeaturesHelper')
const PlanLocator = require('./PlansLocator')
function isProfessionalPlan(planCode) {
const plan = PlanLocator.findLocalPlanInSettings(planCode)
// only identify "modern" professional group plans as eligible, and do not include legacy plans
return Boolean(
planCode?.includes('professional') &&
FeaturesHelper.getMatchedFeatureSet(plan?.features) === 'professional'
)
}
module.exports = {
isProfessionalPlan,
}