protected function checkGetId(Model $authority, $ability, $model = null)
{
$applicable = $this->compileAbilityIdentifiers($ability, $model);
// We will first check if any of the applicable abilities have been forbidden.
// If so, we'll return false right away, so as to not pass the check. Then,
// we'll check if any of them have been allowed & return the matched ID.
$forbiddenId = $this->findMatchingAbility($this->getForbiddenAbilities($authority), $applicable, $model, $authority);
if ($forbiddenId) {
return false;
}
return $this->findMatchingAbility($this->getAbilities($authority), $applicable, $model, $authority);
}