Common#

NAME#

Kernel::GenericInterface::Operation::Common - Base class for all Operations

PUBLIC INTERFACE#

Auth()#

performs user or customer user authorization

my ( $UserID, $UserType ) = $CommonObject->Auth(
    Data => {
        SessionID         => 'AValidSessionIDValue',    # the ID of the user session
        UserLogin         => 'Agent1',                  # optional, provide UserLogin or CustomerUserLogin
        # or
        CustomerUserLogin => 'Customer1',               # optional, provide UserLogin or CustomerUserLogin

        Password          => 'some password',           # user password
    },
);

returns

(
    1,                                              # the UserID from login or session data
    'User',                                         # || 'Customer' or 'User', 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',
);

_AuthUser()#

performs user authentication

my $UserID = $CommonObject->_AuthUser(
    UserLogin => 'Agent',
    Password  => 'some password',           # plain text password
);

returns

$UserID = 1;                                # the UserID from login or session data

_AuthCustomerUser()#

performs customer user authentication

my $UserID = $CommonObject->_AuthCustomerUser(
    CustomerUserLogin' => 'Customer1',
    Password           => 'some password',           # plain text password
);

returns

$UserID = 1;                               # the UserID from login or session data