MT#60674 Fix page permission for CE users

After having added license check is some of the CSC pages
we noticed that CSC call page cannot be accessed anymore
by CE users.
This commit fix this issue and also address a typo in the
required license to access the fax pages.

Change-Id: Ifc6cfa9b41cd53417da43f44a736076b82fcc9cb
mr13.0
Marco Capetta 2 years ago committed by Debora Crescenzo
parent 4f8015c9b1
commit bc1b4f3fbe

@ -36,8 +36,12 @@ export default ({ app, router, store }) => {
if (to.meta?.profileAttribute) { if (to.meta?.profileAttribute) {
const hasSubscriberProfileAttribute = store.getters['user/hasSubscriberProfileAttribute'](to.meta.profileAttribute) const hasSubscriberProfileAttribute = store.getters['user/hasSubscriberProfileAttribute'](to.meta.profileAttribute)
if (to.meta.license && hasSubscriberProfileAttribute) { if (to.meta.license && hasSubscriberProfileAttribute) {
// Guard to assure that users cannot click on menu if // Guard to assure that:
// it is mistakenly visible when the license is inactive // CE users have access to all available menus as they do not have licenses
if (store.platformInfo.type === 'spce') {
next()
}
// users cannot click on menu if it is mistakenly visible when the license is inactive
store.getters['user/isLicenseActive'](to.meta.license) ? next() : next('/') store.getters['user/isLicenseActive'](to.meta.license) ? next() : next('/')
} }

@ -51,7 +51,8 @@ export default {
'hasSubscriberProfileAttributes', 'hasSubscriberProfileAttributes',
'isLicenseActive', 'isLicenseActive',
'isOldCSCProxyingAllowed', 'isOldCSCProxyingAllowed',
'isPbxEnabled' 'isPbxEnabled',
'isSpCe'
]), ]),
items () { items () {
return [ return [
@ -66,7 +67,7 @@ export default {
icon: 'call', icon: 'call',
label: this.callStateTitle, label: this.callStateTitle,
sublabel: this.callStateSubtitle, sublabel: this.callStateSubtitle,
visible: this.hasSubscriberProfileAttribute(PROFILE_ATTRIBUTE_MAP.cscCalls) && this.isLicenseActive(LICENSES.csc_calls) visible: this.hasSubscriberProfileAttribute(PROFILE_ATTRIBUTE_MAP.cscCalls && (this.isSpCe || this.isLicenseActive(LICENSES.csc_calls)))
}, },
{ {
to: '/user/conversations', to: '/user/conversations',
@ -138,7 +139,7 @@ export default {
to: '/user/recordings', to: '/user/recordings',
icon: 'play_circle', icon: 'play_circle',
label: this.$t('Recordings'), label: this.$t('Recordings'),
visible: this.hasSubscriberProfileAttribute(PROFILE_ATTRIBUTE_MAP.recordings) && this.isLicenseActive(LICENSES.call_recording) visible: this.hasSubscriberProfileAttribute(PROFILE_ATTRIBUTE_MAP.recordings) && (this.isSpCe || this.isLicenseActive(LICENSES.call_recording))
} }
] ]
}, },

@ -434,7 +434,7 @@ const routes = [
return i18n.global.tc('Set your fax settings') return i18n.global.tc('Set your fax settings')
}, },
profileAttribute: PROFILE_ATTRIBUTE_MAP.faxServer, profileAttribute: PROFILE_ATTRIBUTE_MAP.faxServer,
license: LICENSES.phonebook license: LICENSES.fax
} }
}, },
{ {

@ -209,6 +209,9 @@ export default {
}, },
isPbxAttendant (state, getters) { isPbxAttendant (state, getters) {
return getters.isPbxPilot || getters.isPbxGroup || getters.isPbxSeat return getters.isPbxPilot || getters.isPbxGroup || getters.isPbxSeat
},
isSpCe (state) {
return state.platformInfo.type === 'spce'
} }
}, },
mutations: { mutations: {

Loading…
Cancel
Save