NAME

plenigo::AccessRightsManager - A utility class to get/add/remove access rights from/to a customer. 

SYNOPSIS

use plenigo::AccessRightsManager;

# Prepare configuration

my $activate_testing = 0;
my $configuration = plenigo::Configuration->new(company_id => 'YOUR_COMPANY_ID, secret => 'YOUR_SECRET', staging => $activate_testing);

# Instantiate access rights manager

my $access_rights = plenigo::AccessRightsManager->new(configuration => $configuration);

# Checking access rights from a customer

my %access_rights = $access_rights->hasAccess($plenigo_customer_id, ['ACCESS_RIGHT_ID']); 
if ($access_rights{'accessGranted'}) {
    # customer has the right to access 
}
else {
    # customer is not allowed to access
}

# Adding access rights to a customer

$access_rights->addAccess($plenigo_customer_id, (details => [{productId => 'ACCESS_RIGHT_ID'}]));

# Removing access rights from a customer

$access_rights->removeAccess($plenigo_customer_id, ['ACCESS_RIGHT_ID']);

DESCRIPTION

plenigo::AccessRightsManager provides functionality to manage access rights of a customer.

METHODS

hasAccess($customer_id, @product_ids)

Test if a customer has access rights.

addAccess($customer_id, %access_request)

Add access rights to a customer.

removeAccess($customer_id, @product_ids)

Remove access rights from a customer.