plenigo::AccessRightsManager - A utility class to get/add/remove access rights from/to a customer.
SYNOPSIS
use plenigo::AccessRightsManager;
# Prepare configuration
my $use_stage = 0; # set if stage system should be used
my $configuration = plenigo::Configuration->new(access_token => 'ACCESS_TOKEN', use_stage => $use_stage);
# 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.