diff --git a/Core/Executor/RoleManager.php b/Core/Executor/RoleManager.php index bdeb955..98097eb 100644 --- a/Core/Executor/RoleManager.php +++ b/Core/Executor/RoleManager.php @@ -487,16 +487,15 @@ protected function sortPolicyDefinitions(array &$policies) return $fComp; } // ugly: sort by comparing limitations identifiers - return $this->compareArraysForSorting($p1['limitations'], $p2['limitations']); + /// @todo if limitations identifiers are the same, sort by lim. values... $p1LimIds = array(); $p2LimIds = array(); foreach ($p1['limitations'] as $lim) { - $p1LimIds = $lim['identifier']; + $p1LimIds[] = $lim['identifier']; } foreach ($p2['limitations'] as $lim) { - $p2LimIds = $lim['identifier']; + $p2LimIds[] = $lim['identifier']; } - /// @todo if limitations identifier are the same, sort by lim. values... return $this->compareArraysForSorting($p1LimIds, $p2LimIds); }); } @@ -516,7 +515,7 @@ protected function compareArraysForSorting($a1, $a2) return $cmp; } } - // the array with less elements wins + // the array with fewer elements wins return count($a1) - count($a2); } }