Class: Com::Vmware::Vapi::Std::Errors::Unauthorized

Inherits:
Error
  • Object
show all
Defined in:
/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vapi/std/errors.rb

Overview

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  nil , 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.

Instance Attribute Summary

Attributes inherited from Error

#data, #messages

Class Method Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Unauthorized) initialize(binding_type = self.class.binding_type, error_value = nil)

Constructs a new instance.

Parameters:

  • binding_type (VAPI::Bindings::BindingType) (defaults to: self.class.binding_type)

    the specific BindingType declaration for this concrete VapiError type

  • error_value (VAPI::Data::ErrorValue) (defaults to: nil)

    the error value (default nil)



305
306
307
# File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vapi/std/errors.rb', line 305

def initialize(binding_type=self.class.binding_type, error_value=nil)
    super(binding_type, error_value)
end

Class Method Details

+ (VAPI::Bindings::ErrorType) binding_type

Holds (gets or creates) the binding type metadata for this error type.

Returns:

  • (VAPI::Bindings::ErrorType)

    the binding type



289
290
291
292
293
294
295
296
297
# File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vapi/std/errors.rb', line 289

def binding_type
    @binding_type ||= VAPI::Bindings::ErrorType.new(
        'com.vmware.vapi.std.errors.unauthorized',
        {
            'messages' => VAPI::Bindings::ListType.new(VAPI::Bindings::ReferenceType.new('Com::Vmware::Vapi::Std::LocalizableMessage')),
            'data' => VAPI::Bindings::OptionalType.new(VAPI::Bindings::DynamicStructType.new()),
        },
        Unauthorized)
end