protected function validatePolicy($module, $function, array $limitations)
{
if ($module !== '*' && $function !== '*' && !empty($limitations)) {
$limitationSet = array();
foreach ($limitations as $limitation) {
if (isset($limitationSet[$limitation->getIdentifier()])) {
throw new InvalidArgumentException('limitations', "'{$limitation->getIdentifier()}' was found several times among the limitations");
}
if (!isset($this->settings['policyMap'][$module][$function][$limitation->getIdentifier()])) {
throw new InvalidArgumentException('policy', "The limitation '{$limitation->getIdentifier()}' is not applicable on '{$module}/{$function}'");
}
$limitationSet[$limitation->getIdentifier()] = true;
}
}
return $this->limitationService->validateLimitations($limitations);
}