Scripting Object - VcAuthorizationManager

Scripting-object corresponding to
AuthorizationManager
Attribute of
VcSdkConnection, VcServiceContent

Scripting Object Description

This managed object provides operations to query and update roles and permissions.

Privileges are the basic individual rights required to perform operations. They are statically defined and never change for a single version of a product. Examples of privileges are "Power on a virtual machine" or "Configure a host."

Roles are aggregations of privileges, used for convenience. For user-defined roles, the system-defined privileges, "System.Anonymous", "System.View", and "System.Read" are always present.

Permissions are the actual access-control rules. A permission is defined on a ManagedEntity and specifies the user or group ("principal") to which the rule applies. The role specifies the privileges to apply, and the propagate flag specifies whether or not the rule applies to sub-objects of the managed entity.

A ManagedEntity may have multiple permissions, but may have only one permission per user or group. If, when logging in, a user has both a user permission and a group permission (as a group member) for the same entity, then the user-specific permission takes precedent. If there is no user-specific permission, but two or more group permissions are present, and the user is a member of the groups, then the privileges are the union of the specified roles.

Managed entities may be collected together into a "complex entity" for the purpose of applying permissions consistently. Complex entities may have a Datacenter, ComputeResource, or ClusterComputeResource as a parent, with other child managed objects as additional parts of the complex entity:

Child objects in a complex entity are forced to inherit permissions from the parent object. When query operations are used to discover permissions on child objects of complex entities, different results may be returned for the owner of the permission. In some cases, the child object of the complex entity is returned as the object that defines the permission, and in other cases, the parent from which the permission is propagated is returned as the object that defines the permission. In both cases, the information about the owner of the permission is correct, since the entities within a complex entity are considered equivalent. Permissions defined on complex entities are always applicable on the child entities, regardless of the propagation flag, but may only be defined or modified on the parent object.

In a group of fault-tolerance (FT) protected VirtualMachines, the secondary VirtualMachines are forced to inherit permissions from the primary VirtualMachine. Queries to discover permissions on FT secondary VMs always return the primary VM as the object that defines the permissions. Permissions defined on an FT primary VM are always applicable on its secondary VMs, but can only be defined or modified on the primary VM.

Attributes

Name Type Description
descriptionVcAuthorizationDescription

@since VI API 2.5
idString

@since Unknown
morefVcManagedObjectReference

returns the ManagedObjectReference of this ManagedObject @since Unknown
privilegeListVcAuthorizationPrivilege []

@since VI API 2.5
roleListVcAuthorizationRole []

@since VI API 2.5
sdkConnectionVcSdkConnection

@since Unknown
sdkIdString

@since Unknown
typeStringDeprecated.

Returns the name for the this managed object's vim type @since Unknown
vimHostVcSdkConnection

@since Unknown
vimIdString

@since Unknown
vimTypeString

@since Unknown

Methods

Methods defined in this Scripting Object
_getRef, addAuthorizationRole, checkMethodInvocation, createTrigger, disableMethods, enableMethods, fetchUserPrivilegeOnEntities, hasPrivilegeOnEntities, hasPrivilegeOnEntity, hasUserPrivilegeOnEntities, mergePermissions, queryDisabledMethods, queryPermissions, removeAuthorizationRole, removeEntityPermission, resetEntityPermissions, retrieveAllPermissions, retrieveEntityPermissions, retrievePermissions, retrieveRolePermissions, setEntityPermissions, updateAuthorizationRole

hasPrivilegeOnEntities

Check whether a session holds a set of privileges on a set of managed entities.

If the session does not exist, false is returned for all privileges of all the entities.

This API is implemented only by vCenter Server.

@since vSphere API 5.5

Parameters

NameTypeDescription
arg0VcManagedEntity []

arg1String

arg2String []


Return Value

Type Description
VcEntityPrivilege []

updateAuthorizationRole

Updates a role's name or privileges. If the new set of privileges are assigned to the role, the system-defined privileges, "System.Anonymous", "System.View", and "System.Read" will be assigned to the role too. This operation might return before the new privileges are effective. A timeout of 100 ms is possible, but it might vary depending on the configuration and the load of the system. @since VI API 2.5

Parameters

NameTypeDescription
arg0Number

arg1String

arg2String []


Return Value

Type Description
None

_getRef

@since Unknown

Parameters

NameTypeDescription
None

Return Value

Type Description
VcManagedObjectReference

hasUserPrivilegeOnEntities

Checks if a user holds a certain set of privileges on a number of managed entities. Privileges may be granted to users through their respective group membership. If a privilege is granted to a group it is implicitly granted to its members.

This API is implemented only by vCenter Server.

@since vSphere API 6.5

Parameters

NameTypeDescription
arg0VcManagedObject []

arg1String

arg2String []


Return Value

Type Description
VcEntityPrivilege []

enableMethods

Enable given set of methods on specified set of target entities.

A method disabled by VirtualCenter may not be enabled by any source. If multiple sources disable the same method then the method must be enabled by all sources before it can be invoked. A method is disabled if it is disabled for any source. Multiple requests to enable the same method on the same target entity using the same sourceId are idempotent, for example, they have the same effect as a single request. If the sourceId is not provided, then all methods are enabled on all target entities for all sources except for those methods disabled by VirtualCenter itself. @since VI API 2.5

Parameters

NameTypeDescription
arg0VcManagedEntity []

arg1String []

arg2String


Return Value

Type Description
VcEntityDisabledMethodInfo []

fetchUserPrivilegeOnEntities

Get the list of effective privileges for a user, either granted explicitly, or through group membership.

This API is implemented only by vCenter Server.

@since vSphere API 6.5

Parameters

NameTypeDescription
arg0VcManagedEntity []

arg1String


Return Value

Type Description
VcUserPrivilegeResult []

queryPermissions

Returns the permision requirements for the specified request.

vCenter Server must invoke this method to check if the current user has the required privileges to be granted a ticket returned from {@link vim.SessionManager#acquireGenericServiceTicket}.

This is needed because the ESXi host does not know anything about the users of vCenter Server and vCenter Server does not know anything about the specified request.

NOTE: This method is internal and currently does not translate the MOIDs in the result from host namespace to VC namespace. See PR 612543. It cannot be made public until this bug is fixed. @since vSphere API 5.0

Parameters

NameTypeDescription
arg0VcSessionManagerServiceRequestSpec


Return Value

Type Description
VcAuthorizationManagerRequiredPermission []

hasPrivilegeOnEntity

Check whether a session holds a set of privileges on a managed entity.

If the session does not exist, false is returned for all privileges.

This API is implemented only by vCenter Server.

@since vSphere API 5.0

Parameters

NameTypeDescription
arg0VcManagedEntity

arg1String

arg2String []


Return Value

Type Description
Boolean []

resetEntityPermissions

Update the entire set of permissions defined on an entity. Any existing permissions on the entity are removed and replaced with the provided set.

If a permission is specified multiple times for the same user or group, the last permission specified takes effect.

The operation is transactional per permission and could partially fail. The updates are performed in the order of the permission array argument. The first failed update will abort the operation and throw the appropriate exception. When the operation aborts, any permissions that have not yet been removed are left in their original state.

After updates are applied, original permissions that are not in the new set are removed. A failure to remove a permission, such as a violation of the minimum administrator permission rule, will abort the operation and could leave remaining original permissions still effective on the entity.

This will fail with an InvalidArgument fault if called on: the direct child folders of a datacenter managed object, the root resource pool of a ComputeResource or ClusterComputeResource, or a HostSystem that is part of a ComputeResource (Stand-alone Host). These objects always have the same permissions as their parent.

This will fail with an InvalidArgument fault if called on a fault-tolerance (FT) secondary VirtualMachine. Such a VirtualMachine always has the same permissions as its FT primary VirtualMachine. @since VI API 2.5

Parameters

NameTypeDescription
arg0VcManagedEntity

arg1VcPermission []


Return Value

Type Description
None

mergePermissions

Reassigns all permissions of a role to another role. @since VI API 2.5

Parameters

NameTypeDescription
arg0Number

arg1Number


Return Value

Type Description
None

removeAuthorizationRole

Removes a role. @since VI API 2.5

Parameters

NameTypeDescription
arg0Number

arg1Boolean


Return Value

Type Description
None

checkMethodInvocation

Check whether a session holds a set of privileges required to invoke a specified method with specified parameters on an entity.

If the session or entity does not exist, or the session does not have the requisite privileges, an exception is thrown.

This API is implemented only by vCenter Server.

@since vim legacy version

Parameters

NameTypeDescription
arg0VcManagedEntity

arg1String

arg2String

arg3Object []


Return Value

Type Description
None

setEntityPermissions

Defines one or more permission rules on an entity or updates rules if already present for the given user or group on the entity.

If a permission is specified multiple times for the same user or group, then the last permission specified takes effect.

The operation is applied transactionally per permission and is applied to the entity following the order of the elements in the permission array argument. This means that if a failure occurs, the method terminates at that point in the permission array with an exception, leaving at least one and as many as all permissions unapplied.

This will fail with an InvalidArgument fault if called on: the direct child folders of a datacenter managed object, the root resource pool of a ComputeResource or ClusterComputeResource, or a HostSystem that is part of a ComputeResource (Stand-alone Host). These objects always have the same permissions as their parent.

This will fail with an InvalidArgument fault if called on a fault-tolerance (FT) secondary VirtualMachine. Such a VirtualMachine always has the same permissions as its FT primary VirtualMachine. @since VI API 2.5

Parameters

NameTypeDescription
arg0VcManagedEntity

arg1VcPermission []


Return Value

Type Description
None

createTrigger

@since Unknown

Parameters

NameTypeDescription
timeoutNumber

filterString

conditionString

filterToSyncString


Return Value

Type Description
Trigger

retrievePermissions

Finds all permissions defined on the local inventory objects. The resulting permissions list will not include the global ones. If the caller is interested in both local and global permissions then the AuthorizationService#getAllPermissions should be invoked. Global permissions are those defined through the Authorization Service and are applied on all object hierarchies. The result is restricted to the managed entities visible to the user making the call. This API is implemented only by vCenter Server. @since vSphere API 6.5

Parameters

NameTypeDescription
None

Return Value

Type Description
VcPermission []

retrieveRolePermissions

Finds all the permissions that use a particular role. The result is restricted to managed entities that are visible to the user making the call. @since VI API 2.5

Parameters

NameTypeDescription
arg0Number


Return Value

Type Description
VcPermission []

disableMethods

Disable given set of methods on specified set of target entities.

The method(s) in the request must denote valid operation(s) on all target entities. Multiple requests to disable the same method on the same target entity using the same sourceId are idempotent, for example, they have the same effect as a single request. If a source attempts to disable a method that is already disabled then a MethodAlreadyDisabledFault will be thrown. The source that disables a particular method can still invoke it as long as the invocation occurs from the same session that was used to disable the method.

A disabled method throws "MethodDisabled" fault if it is invoked by a client. @since VI API 2.5

Parameters

NameTypeDescription
arg0VcManagedEntity []

arg1VcDisabledMethodRequest []

arg2String

arg3Boolean


Return Value

Type Description
None

queryDisabledMethods

This is a query method that returns a list of objects describing operations that have been disabled on the target entity. The methods may be disabled either depending on the current run-time state of the entity or by explicit calls to disableMethods. The query method provides additional information about each disabled method such as who disabled the method or why it was disabled. This iformation may be used by clients to enable or disable methods in a graphical user interface. @since VI API 2.5

Parameters

NameTypeDescription
arg0VcManagedEntity


Return Value

Type Description
VcDisabledMethodInfo []

addAuthorizationRole

Adds a new role. This method will add a user-defined role with given list of privileges and three system-defined privileges, "System.Anonymous", "System.View", and "System.Read". @since VI API 2.5

Parameters

NameTypeDescription
arg0String

arg1String []


Return Value

Type Description
Number

retrieveAllPermissions

Finds all permissions defined in the system. The result is restricted to the managed entities visible to the user making the call. @since VI API 2.5

Parameters

NameTypeDescription
None

Return Value

Type Description
VcPermission []

retrieveEntityPermissions

Gets permissions defined on or effective on a managed entity. This returns the actual permission objects defined in the system for all users and groups relative to the managed entity. The inherited flag specifies whether or not to include permissions defined by the parents of this entity that propagate to this entity.

For complex entities, the entity reported as defining the permission may be either the parent or a child entity belonging to the complex entity.

The purpose of this method is to discover permissions for administration purposes, not to determine the current permissions. The current user's permissions are found on the {@link vim.ManagedEntity#effectiveRole} property of the user's ManagedEntity. @since VI API 2.5

Parameters

NameTypeDescription
arg0VcManagedEntity

arg1Boolean


Return Value

Type Description
VcPermission []

removeEntityPermission

Removes a permission rule from an entity.

This will fail with an InvalidArgument fault if called on: the direct child folders of a datacenter managed object, the root resource pool of a ComputeResource or ClusterComputeResource, or a HostSystem that is part of a ComputeResource (Stand-alone Host). These objects always have the same permissions as their parent.

This will fail with an InvalidArgument fault if called on a fault-tolerance (FT) secondary VirtualMachine. Such a VirtualMachine always has the same permissions as its FT primary VirtualMachine. @since VI API 2.5

Parameters

NameTypeDescription
arg0VcManagedEntity

arg1String

arg2Boolean


Return Value

Type Description
None