feat(xo-server/VIF): set MAC address requires Admin ACL on network (#5631)
Fixes #4700
This commit is contained in:
parent
6ea71ec6a2
commit
872b05a7de
@ -7,6 +7,8 @@
|
||||
|
||||
> Users must be able to say: “Nice enhancement, I'm eager to test it”
|
||||
|
||||
- [VIF] To edit MAC address on a VIF, user has to be operator of the VIF and administrator of its network [#4700](https://github.com/vatesfr/xen-orchestra/issues/4700) (PR [#5631](https://github.com/vatesfr/xen-orchestra/pull/5631))
|
||||
|
||||
### Bug fixes
|
||||
|
||||
> Users must be able to say: “I had this issue, happy to know it's fixed”
|
||||
|
@ -89,6 +89,9 @@ export async function set({
|
||||
|
||||
if (isNetworkChanged || mac) {
|
||||
const networkId = network?.id
|
||||
if (mac !== undefined && this.user.permission !== 'admin') {
|
||||
await this.checkPermissions(this.user.id, [[networkId ?? vif.$network, 'administrate']])
|
||||
}
|
||||
if (networkId !== undefined && this.user.permission !== 'admin') {
|
||||
if (resourceSet !== undefined) {
|
||||
await this.checkResourceSetConstraints(resourceSet, this.user.id, [networkId])
|
||||
|
Loading…
Reference in New Issue
Block a user