Permalink
Browse files

Getting empty Roles object instead null

  • Loading branch information...
1 parent ace7c3f commit 071954b20d3ba4835535ed50d3060ab141a463ef @Bukarinov Bukarinov committed Dec 5, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 library/GeometriaLab/Permissions/Assertion/Roles/AbstractRoles.php
@@ -98,6 +98,10 @@ protected function hasRoleForProperty($property, $role, $resource, $objectId)
*/
protected function getPermissionByResourceName($resourceName)
{
+ if ($this->resourceRoles === null) {
+ return null;
+ }
+
if ($this->resourceRolesMap === null) {
// @TODO Add feature getting Model from array by id
foreach ($this->resourceRoles as $index => $resourceRole) {

0 comments on commit 071954b

Please sign in to comment.