VMware vSphere Automation SDK Perl The VMware vSphere Automation SDK for Perl supports the client-side vSphere Automation API for access to vSphere services and capabilities

- Main Page
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Files Functions
List of all members
Com::Vmware::Vapi::Std::Errors::Unauthorized Class Reference
Inheritance diagram for Com::Vmware::Vapi::Std::Errors::Unauthorized:

## Avaliable Methods
public method | new ()

## Detailed Description

The `Com::Vmware::Vapi::Std::Errors::Unauthorized` error indicates that the user is not authorized to perform the method .

API requests may include a security context containing user credentials. For example, the user credentials could be a SAML token, a user name and password, or the session identifier for a previously established session. Invoking the method may require that the user identified by those credentials has particular privileges on the method* or on one or more resource identifiers passed to the method .

Examples:

- The method requires that the user have one or more privileges on the method , but the user identified by the credentials in the security context does not have the required privileges.
- The method requires that the user have one or more privileges on a resource identifier passed to the method , but the user identified by the credentials in the security context does not have the required privileges.

Counterexamples:

- The SAML token in the request's security context has expired. A class Com::Vmware::Vapi::Std::Errors::Unauthenticated error would be used instead.
- The user name and password in the request's security context are invalid. The class Com::Vmware::Vapi::Std::Errors::Unauthenticated error would be used instead.
- The session identifier in the request's security context identifies a session that has expired. The class Com::Vmware::Vapi::Std::Errors::Unauthenticated error would be used instead.

For security reasons, the :attr:`Com::Vmware::Vapi::Std::Errors::Error.data` field* in this error is null , and the :attr:`Com::Vmware::Vapi::Std::Errors::Error.messages` field in this error does not disclose why the user is not authorized to perform the method . For example the messages would not disclose which privilege the user did not have or which resource identifier the user did not have the required privilege to access. The API documentation should indicate what privileges are required.

## Member Function Documentation

public method Com::Vmware::Vapi::Std::Errors::Unauthorized::new | ( |  | ) |

Constructor to initialize the Com::Vmware::Vapi::Std::Errors::Unauthorized structure

Return values

  Blessed | object

Code:
click to view
# Number of lines of code in new: 14
sub new {
my ($class, %args) = @_;
$class = ref($class) || $class;
my $validatorList = [];
my $self = $class->SUPER::new('validator_list' => $validatorList, %args);
$self->set_binding_class('binding_class' => 'Com::Vmware::Vapi::Std::Errors::Unauthorized');
$self->set_binding_name('name' => 'com.vmware.vapi.std.errors.unauthorized');
bless $self, $class;
return $self;
}

The documentation for this class was generated from the following file:

- Com/Vmware/Vapi/Std/Errors/Unauthorized.pm