mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
Fixed problem in tree view with parent nodes and permissions. Ticket#3388
This commit is contained in:
parent
e808ba7e76
commit
daae8b9088
@ -1130,6 +1130,14 @@ class Tree {
|
|||||||
foreach ($items as $item) {
|
foreach ($items as $item) {
|
||||||
$groups[$item['id']] = $this->getProcessedItem($item);
|
$groups[$item['id']] = $this->getProcessedItem($item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If user have not permissions in parent, set parent node to 0 (all)
|
||||||
|
$user_groups_with_privileges = users_get_groups($config['id_user']);
|
||||||
|
foreach ($groups as $id => $group) {
|
||||||
|
if (!in_array($groups[$id]['parent'], array_keys($user_groups_with_privileges))) {
|
||||||
|
$groups[$id]['parent'] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
// Build the group hierarchy
|
// Build the group hierarchy
|
||||||
foreach ($groups as $id => $group) {
|
foreach ($groups as $id => $group) {
|
||||||
if (isset($groups[$id]['parent']) && ($groups[$id]['parent'] != 0)) {
|
if (isset($groups[$id]['parent']) && ($groups[$id]['parent'] != 0)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user