Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix debugusergroup for the superuser group #44419

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions administrator/components/com_users/tmpl/debuggroup/default.php
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@

defined('_JEXEC') or die;

use Joomla\CMS\Access\Access;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
@@ -24,6 +25,14 @@
$wa = $this->getDocument()->getWebAssetManager();
$wa->useScript('table.columns');

/**
* Get the group ID and check if the group is a super user group
* Super user groups have the core.admin action allowed by default,
* but they have not the usual access checks.
*/
$groupId = $this->state->get('group_id');
$isSuperUserGroup = Access::checkGroup($groupId, 'core.admin');

?>
<form action="<?php echo Route::_('index.php?option=com_users&view=debuggroup&group_id=' . (int) $this->state->get('group_id')); ?>" method="post" name="adminForm" id="adminForm">
<div id="j-main-container" class="j-main-container">
@@ -49,7 +58,7 @@
<?php foreach ($loginActions as $action) :
$name = $action[0];
$check = $this->items[0]->checks[$name];
if ($check === true) :
if ($check === true || $isSuperUserGroup) :
$class = 'text-success icon-check';
$button = 'btn-success';
$text = Text::_('COM_USERS_DEBUG_EXPLICIT_ALLOW');
@@ -109,7 +118,7 @@
<?php
$name = $action[0];
$check = $item->checks[$name];
if ($check === true) :
if ($check === true || $isSuperUserGroup) :
$class = 'text-success icon-check';
$button = 'btn-success';
$text = Text::_('COM_USERS_DEBUG_EXPLICIT_ALLOW');