Skip to content

Commit ba89e06

Browse files
author
rmcdaniel
committed
Merge pull request #2 from fwarren/permissions_sequential_array
fix json_ecode error for non-sequential permissions array (thanks fwarren)
2 parents 7d8e6ba + 24f1f84 commit ba89e06

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

api/application/helpers/acl_helper.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ function userPermissions($user, $resource) {
146146
$roles = $this->userRoles($user);
147147
$permissions = array();
148148
foreach ($roles as $role) {
149-
$permissions = array_unique(array_merge($permissions, $this->rolePermissions($role, $resource)));
149+
$permissions = array_values(array_unique(array_merge($permissions, $this->rolePermissions($role, $resource))));
150150
}
151151
return $permissions;
152152
}
@@ -217,4 +217,4 @@ static function authenticate($resource = '', $permissions = '')
217217
}
218218
}
219219

220-
}
220+
}

0 commit comments

Comments
 (0)