/**
* Check if the context is listed in the allowed of forbidden lists and return the result.
*
* @param string $context Context to check
*
* @return boolean
*/
protected function checkAllowedAndForbiddenlist($context)
{
$allowedlist = \array_filter((array) $this->params->get('allowedlist', []));
$forbiddenlist = \array_filter((array) $this->params->get('forbiddenlist', []));
if (!empty($allowedlist)) {
foreach ($allowedlist as $allowed) {
if ($context === $allowed) {
return true;
}
}
return false;
}
foreach ($forbiddenlist as $forbidden) {
if ($context === $forbidden) {
return false;
}
}
return true;
}