Kernel::GenericInterface::Operation::Common

NAME

Kernel::GenericInterface::Operation::Common – Base role for all Operations

PUBLIC INTERFACE

has DebuggerObject

Attribute that holds the debugger object.

has WebserviceID

Attribute that holds the web-service ID.

new()

Usually, you want to create an instance of this by using Kernel::GenericInterface::Operation->new();

Auth()

performs user or customer user authorization

    my ( $UserID, $UserType ) = $CommonObject->Auth(
        Data => {
            AccessToken       => 'AValidAccessTokenValue'   # the AccessToken of the user session
            UserLogin         => 'Agent',                   # if no AccessToken is given UserLogin or
                                                            #   CustomerUserLogin is required
            CustomerUserLogin => 'Customer',
            Password  => 'some password',                   # user password
        },
    );

    returns

    (
        1,                                              # the UserID from login or session data
        'Agent',                                        # || 'Customer', the UserType.
    );

ReturnError()

helper function to return an error message.

    my $Return = $CommonObject->ReturnError(
        ErrorCode    => Ticket.AccessDenied,
        ErrorMessage => 'You don't have rights to access this ticket',
    );

ValidateMimeType()

checks if the given MimeType is valid.

    my $Success = $CommonObject->ValidateMimeType(
        MimeTypeID => 'some MimeType',
    );

    returns
    $Success = 1            # or 0

ValidateCharset()

checks if the given Charset is valid.

    my $Success = $CommonObject->ValidateCharset(
        Charset => 'some charset',
    );

    returns
    $Success = 1            # or 0
Scroll to Top