if (null ===
$privilege) { // query on all privileges
do { // depth-first search on $role if it is not 'allRoles' pseudo-parent
if (null !==
$role && null
!== ($result =
$this->
_roleDFSAllPrivileges($role,
$resource,
$privilege))) { return $result;
} // look for rule on 'allRoles' psuedo-parent
if (null
!== ($rules =
$this->
_getRules($resource, null
))) { foreach ($rules['byPrivilegeId'
] as $privilege =>
$rule) { if (self::TYPE_DENY
=== ($ruleTypeOnePrivilege =
$this->
_getRuleType($resource, null,
$privilege))) { return false;
} } if (null
!== ($ruleTypeAllPrivileges =
$this->
_getRuleType($resource, null, null
))) { return self::TYPE_ALLOW ===
$ruleTypeAllPrivileges;
} } // try next Resource
$resource =
$this->_resources
[$resource->
getResourceId()]['parent'
];
}