/** * Checks if active roles have a given permission * * @param integer $permission * @return unknown */ public final function hasPermission(__Permission $permission) { $return_value = false; if ($permission == null) { $return_value = true; } else { $active_roles_equivalent_permission = $this->_active_roles->getEquivalentPermission(); if ($permission->isJuniorPermissionOf($active_roles_equivalent_permission)) { $return_value = $permission->checkPermission(); } } return $return_value; }