Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(xo-web/menu): do not subscribe to unhealthy vdi chains if no permissions #7265

Merged
merged 3 commits into from
Jan 3, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix(xo-web): do not subscribe to unhealthy vdi chains if no permissions
OlivierFL committed Jan 3, 2024
commit 7ac914c333720268bf70c3b3dca77cd76778b626
1 change: 1 addition & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
@@ -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
- [Menu] Don't subscribe to unhealthy VDI chains if user has not enough permissions (PR [#7265](https://github.com/vatesfr/xen-orchestra/pull/7265))
julien-f marked this conversation as resolved.
Show resolved Hide resolved

### Packages to release

8 changes: 6 additions & 2 deletions packages/xo-web/src/common/xo/index.js
Original file line number Diff line number Diff line change
@@ -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(async () => {
const _isAdmin = isAdmin(store.getState())

return _isAdmin ? await _call('sr.getAllUnhealthyVdiChainsLength') : undefined
})

const unhealthyVdiChainsLengthSubscriptionsBySr = {}
export const createSrUnhealthyVdiChainsLengthSubscription = sr => {