public function hasPermission($name, $requireAll = false)
{
if (is_array($name)) {
foreach ($name as $permissionName) {
$hasPermission = $this->hasPermission($permissionName);
if ($hasPermission && !$requireAll) {
return true;
} elseif (!$hasPermission && $requireAll) {
return false;
}
}
// If we've made it this far and $requireAll is FALSE, then NONE of the permissions were found
// If we've made it this far and $requireAll is TRUE, then ALL of the permissions were found.
// Return the value of $requireAll;
return $requireAll;
}
foreach ($this->cachedPermissions() as $permission) {
if ($permission->name == $name) {
return true;
}
}
return false;
}