Collapse All
Parallels Virtualization SDK
ContentsIndex
PreviousUpNext
PrlVm_UpdateSecurity Function
PHT_VIRTUAL_MACHINE

Updates access level for the specified virtual machine.

Syntax
PRL_HANDLE PrlVm_UpdateSecurity(
    PRL_HANDLE hVm, 
    PRL_HANDLE hAccessRights
);
File

PrlApiVm.h

Parameters

hVm
A handle of type PHT_VIRTUAL_MACHINE identifying the virtual machine.
hAccessRights
A handle of type PHT_ACCESS_RIGHTS containing the virtual machine access level information.

Returns

A handle of type PHT_JOB containing the results of this asynchronous operation or PRL_INVALID_HANDLE if there's not enough memory to instantiate the job object.

Remarks

By default, only the owner of a virtual machine has full access to it. All other users are completely unaware of the machine (it will not even appear in the list of the available virtual machines for them). The owner of the virtual machine can change that by setting one of the predefined access levels for the machine. Depending on the level of access set by the owner, other users will be able to see the machine and to perform tasks on it. 

To update the access level, obtain a handle of type PHT_ACCESS_RIGHTS, set the desired level using the PrlAcl_SetAccessForOthers function, and then call this function to apply the changes to the virtual machine. The caller must be the owner of the machine to perform this operation. The PrlAcl_IsCurrentSessionOwner function can be used to determine if the current user is the owner of the virtual machine. 

To get the return code from the PHT_JOB object, use the PrlJob_GetRetCode function. Possible values are: 

PRL_ERR_INVALID_ARG - invalid handle was passed. 

PRL_ERR_ACCESS_DENIED - current user is not the owner of the target virtual machine. 

PRL_ERR_SUCCESS - function completed successfully. 

Links
© 2021 Parallels International GmbH. All rights reserved.