Merge branch 'ent-12879-problema-con-validacion-acl' into 'develop'
Ent 12879 Problema con validación ACL See merge request artica/pandorafms!6935
This commit is contained in:
commit
5ff738eec4
|
@ -560,13 +560,13 @@ if ($is_management_allowed === true && $update_group === true) {
|
|||
}
|
||||
}
|
||||
|
||||
$id_group = (int) get_parameter('id_group');
|
||||
|
||||
// Delete group.
|
||||
if ($is_management_allowed === true
|
||||
&& $delete_group === true
|
||||
&& ((bool) check_acl($config['id_user'], 0, 'PM') === true)
|
||||
&& ((bool) check_acl($config['id_user'], $id_group, 'PM') === true)
|
||||
) {
|
||||
$id_group = (int) get_parameter('id_group');
|
||||
|
||||
$usedGroup = groups_check_used($id_group);
|
||||
|
||||
if (!$usedGroup['return']) {
|
||||
|
@ -880,6 +880,28 @@ if ($tab == 'tree') {
|
|||
|
||||
|
||||
echo "<div id='tree-controller-recipient'></div>";
|
||||
if (users_can_manage_group_all('AR') === false) {
|
||||
$user_groups_acl = users_get_groups(false, 'AR');
|
||||
$groups_acl = implode('","', $user_groups_acl);
|
||||
if (empty($groups_acl) === true) {
|
||||
$is_management_allowed = false;
|
||||
}
|
||||
}
|
||||
|
||||
html_print_div(
|
||||
[
|
||||
'content' => ui_print_info_message(
|
||||
[
|
||||
'no_close' => true,
|
||||
'message' => __('There are no defined groups'),
|
||||
],
|
||||
'',
|
||||
true
|
||||
),
|
||||
'class' => 'invisible',
|
||||
'id' => 'message-tree-info',
|
||||
]
|
||||
);
|
||||
} else {
|
||||
/*
|
||||
* Group list view.
|
||||
|
@ -1246,7 +1268,7 @@ $tab = 'group_edition';
|
|||
treeController.init({
|
||||
recipient: $("div#tree-controller-recipient"),
|
||||
page: parameters['page'],
|
||||
emptyMessage: "<?php echo __('No data found'); ?>",
|
||||
emptyMessage: $("#message-tree-info").html(),
|
||||
foundMessage: "<?php echo __('Found groups'); ?>",
|
||||
tree: data.tree,
|
||||
baseURL: "<?php echo ui_get_full_url(false, false, false, is_metaconsole()); ?>",
|
||||
|
|
|
@ -107,7 +107,7 @@ class Tree
|
|||
|
||||
$userGroupsACL = users_get_groups(false, $this->access);
|
||||
|
||||
$this->userGroupsACL = empty($userGroupsACL) ? false : $userGroupsACL;
|
||||
$this->userGroupsACL = empty($userGroupsACL) ? [0] : $userGroupsACL;
|
||||
$this->userGroups = $this->userGroupsACL;
|
||||
$this->userGroupsArray = array_keys($this->userGroups);
|
||||
|
||||
|
|
Loading…
Reference in New Issue