fix(xo-web/menu): don't subscribe to unhealthy vdi chains if not admin (#7265)
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
> Users must be able to say: “I had this issue, happy to know it's fixed”
|
||||
|
||||
- [Proxies] Fix `this.getObject` is not a function during deployment
|
||||
- [Settings/Logs] Fix `sr.getAllUnhealthyVdiChainsLength: not enough permissions` error with non-admin users (PR [#7265](https://github.com/vatesfr/xen-orchestra/pull/7265))
|
||||
|
||||
### Packages to release
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ import store from 'store'
|
||||
import WarmMigrationModal from './warm-migration-modal'
|
||||
import { alert, chooseAction, confirm } from '../modal'
|
||||
import { error, info, success } from '../notification'
|
||||
import { getObject } from 'selectors'
|
||||
import { getObject, isAdmin } from 'selectors'
|
||||
import { getXoaPlan, SOURCES } from '../xoa-plans'
|
||||
import { noop, resolveId, resolveIds } from '../utils'
|
||||
import {
|
||||
@@ -564,7 +564,11 @@ subscribeVolumeInfo.forceRefresh = (() => {
|
||||
}
|
||||
})()
|
||||
|
||||
export const subscribeSrsUnhealthyVdiChainsLength = createSubscription(() => _call('sr.getAllUnhealthyVdiChainsLength'))
|
||||
export const subscribeSrsUnhealthyVdiChainsLength = createSubscription(() => {
|
||||
const _isAdmin = isAdmin(store.getState())
|
||||
|
||||
return _isAdmin ? _call('sr.getAllUnhealthyVdiChainsLength') : undefined
|
||||
})
|
||||
|
||||
const unhealthyVdiChainsLengthSubscriptionsBySr = {}
|
||||
export const createSrUnhealthyVdiChainsLengthSubscription = sr => {
|
||||
|
||||
Reference in New Issue
Block a user