Skip to content

Commit

Permalink
Update getPlansPermission and getPlanPermission function logic to det…
Browse files Browse the repository at this point in the history
…erminate permissions
  • Loading branch information
novakzaballa committed Jul 28, 2023
1 parent e9c8cb0 commit 6f62e3a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions frontend/common/utils/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,12 @@ const Utils = Object.assign({}, require('./base/_utils'), {
return planNames.free
},
getPlanPermission: (plan: string, permission: string) => {
let valid = true
const planName = Utils.getPlanName(plan)
if (!Utils.getFlagsmithHasFeature('plan_based_access')) {
if (global.flagsmithVersion?.backend.is_enterprise) {
return true
}
let valid = true
const planName = Utils.getPlanName(plan)

if (!plan || planName === planNames.free) {
return false
}
Expand Down Expand Up @@ -306,7 +307,7 @@ const Utils = Object.assign({}, require('./base/_utils'), {
},

getPlansPermission: (permission: string) => {
if (!Utils.getFlagsmithHasFeature('plan_based_access')) {
if (global.flagsmithVersion?.backend.is_enterprise) {
return true
}
const isOrgPermission = permission !== '2FA'
Expand Down

0 comments on commit 6f62e3a

Please sign in to comment.