Package prlsdkapi :: Class AccessRights
[ hide private ]
[ frames ] | no frames ]

Class AccessRights

object --+    
         |    
   _Handle --+
             |
            AccessRights

Contains info about access rights that the users other than the owner have in respect to the virtual machine.

Instance Methods [ hide private ]
is_allowed ( self , nPermission )
Determine if the current user is authorized to perform a specified task on the virtual machine.
get_access_for_others ( self )
Obtain the virtual machine access rights information.
set_access_for_others ( self , nAccessForOthers )
Set access rights on a virtual machine.
get_owner_name ( self )
Determine the virtual machine owner name.
is_current_session_owner ( self )
Determine if the current user is the owner of the virtual machine.

Inherited from _Handle : __del__ , __init__ , add_ref , free , from_string , get_handle_type , get_package_id , get_type

Inherited from object : __delattr__ , __format__ , __getattribute__ , __hash__ , __new__ , __reduce__ , __reduce_ex__ , __repr__ , __setattr__ , __sizeof__ , __str__ , __subclasshook__

Properties [ hide private ]

Inherited from object : __class__

Method Details [ hide private ]

is_allowed ( self , nPermission )

Determine if the current user is authorized to perform a specified task on the virtual machine.

Parameters:
  • nPermission - The task type. Can be one of constants with the PAR_ prefix, such as: PAR_VM_START_ACCESS, PAR_VM_STOP_ACCESS, PAR_VM_PAUSE_ACCESS, PAR_VM_RESET_ACCESS, PAR_VM_SUSPEND_ACCESS, PAR_VM_RESUME_ACCESS, PAR_VM_DELETE_ACCESS, and others.
Returns:
A Boolean value indicating whether the user is authorized to perform the task. True - authorized; False - not authorized.

get_access_for_others ( self )

Obtain the virtual machine access rights information.

Returns:
One of the following access rights constants: PAO_VM_NOT_SHARED - only the owner of the virtual machine has access to it. PAO_VM_SHARED_ON_VIEW - other users can view but not run the virtual machine. PAO_VM_SHARED_ON_VIEW_AND_RUN - other useres can view and run the vitual machine. PAO_VM_SHARED_ON_FULL_ACCESS - all users have full access to a virtual machine.

set_access_for_others ( self , nAccessForOthers )

Set access rights on a virtual machine.

Parameters:
  • nAccessForOthers - The access rights level to set. Can be one of the following constants: PAO_VM_NOT_SHARED - only the owner of the virtual machine has access to it. PAO_VM_SHARED_ON_VIEW - other users can view the virtual machine. PAO_VM_SHARED_ON_VIEW_AND_RUN - other users can view and run the virtual machine. PAO_VM_SHARED_ON_FULL_ACCESS - all users have full access to the virtual machine.

get_owner_name ( self )

Determine the virtual machine owner name.

Returns:
A string containing the owner name.

is_current_session_owner ( self )

Determine if the current user is the owner of the virtual machine.

Returns:
A Boolean value. True - the current user is the owner. False - the user is not the owner.