Merge pull request #245 from vatesfr/pierre-cpu-weight-in-resource-set
vm.set(): only admins can change cpuWeight if VM in a resource set
This commit is contained in:
commit
0e4a6fd2e1
@ -478,6 +478,8 @@ set = $coroutine (params) ->
|
|||||||
yield xapi.call 'VM.remove_from_other_config', ref, 'auto_poweron'
|
yield xapi.call 'VM.remove_from_other_config', ref, 'auto_poweron'
|
||||||
|
|
||||||
if 'cpuWeight' of params
|
if 'cpuWeight' of params
|
||||||
|
if resourceSet? and this.user.permission isnt 'admin'
|
||||||
|
throw new Unauthorized()
|
||||||
yield xapi.setVcpuWeight(VM._xapiId, params.cpuWeight)
|
yield xapi.setVcpuWeight(VM._xapiId, params.cpuWeight)
|
||||||
|
|
||||||
# Other fields.
|
# Other fields.
|
||||||
|
Loading…
Reference in New Issue
Block a user