 
     permissions.push([
       @getObject(vdiId, 'VDI').$SR,
-      'operate'
+      permission
     ])
   )
 


#=====================================================================

checkPermissionsForSnapshot = (vm) -> (
  permissions = []
  forEach(vm.$VBDs, (vbdId) =>
    vbd = @getObject(vbdId, 'VBD')

#---------------------------------------------------------------------

snapshot = $coroutine ({vm, name}) ->
  yield checkPermissionOnSrs.call(this, vm)

  snapshot = yield @getXAPI(vm).snapshotVm(vm._xapiRef, name)
  return snapshot.$id
