Skip to content

Commit

Permalink
FIX PHP 5.3.0 compatibility fix
Browse files Browse the repository at this point in the history
Changed to instanceof instead of is_a to be compatibile with <5.3.9
  • Loading branch information
Marcus Nyeholt committed Oct 8, 2015
1 parent 30b07c9 commit 83e484a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions code/services/PermissionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -388,18 +388,18 @@ public function checkPerm(DataObject $node, $perm, $member=null) {
}

$grant = null;
if (is_a($access->Type, 'Group', true)) {
$authority = $access->getAuthority();
if ($authority instanceof Group) {
if (isset($gids[$access->AuthorityID])) {
$grant = $access->Grant;
}
} else if (is_a($access->Type, 'Member', true)) {
} else if ($authority instanceof Member) {
if ($member->ID == $access->AuthorityID) {
$grant = $access->Grant;
}
} else {
// another mechanism that will require a lookup of members in a list
// TODO cache this
$authority = $access->getAuthority();
if ($authority instanceof ListOfMembers) {
$listMembers = $authority->getAllMembers()->map('ID', 'Title');
if (isset($listMembers[$member->ID])) {
Expand Down

0 comments on commit 83e484a

Please sign in to comment.