Skip to content

Commit

Permalink
Remove if/else in user debug models that can never hit else conditions (
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Babker authored and laoneo committed Jul 20, 2018
1 parent 3d713fe commit 7b73d5f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 26 deletions.
15 changes: 2 additions & 13 deletions administrator/components/com_users/models/debuggroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,8 @@ public function getItems()
foreach ($actions as $action)
{
$name = $action[0];
$level = $action[1];

// Check that we check this action for the level of the asset.
if ($level === null || $level >= $asset->level)
{
// We need to test this action.
$asset->checks[$name] = JAccess::checkGroup($groupId, $name, $asset->name);
}
else
{
// We ignore this action.
$asset->checks[$name] = 'skip';
}

$asset->checks[$name] = JAccess::checkGroup($groupId, $name, $asset->name);
}
}
}
Expand Down
15 changes: 2 additions & 13 deletions administrator/components/com_users/models/debuguser.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,19 +79,8 @@ public function getItems()
foreach ($actions as $action)
{
$name = $action[0];
$level = $action[1];

// Check that we check this action for the level of the asset.
if ($level === null || $level >= $asset->level)
{
// We need to test this action.
$asset->checks[$name] = $user->authorise($name, $asset->name);
}
else
{
// We ignore this action.
$asset->checks[$name] = 'skip';
}

$asset->checks[$name] = $user->authorise($name, $asset->name);
}
}
}
Expand Down

0 comments on commit 7b73d5f

Please sign in to comment.