Skip to content

Commit 53a2dcc

Browse files
ciberfredstonebuzz
andauthored
Fix(Core): Hide items without proper user access rights in the family list. (#392)
* Update familylist.php to remove items that user don't have right access instead listing all items of a family, and on click get 'you don't have access' error message, juste remove it from the listing. * Update familylist.php * fix CS * adapt CHANGELOG --------- Co-authored-by: stonebuzz <[email protected]>
1 parent a6fcbb5 commit 53a2dcc

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77

88
## [Unreleased]
99

10+
### Fixed
11+
12+
- Hide `items` without proper user access rights in the family list.
13+
1014
## [2.14.10] - 2024-09-06
1115

1216
### Fixed

front/familylist.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,12 @@
5757
echo "<tr class='tab_bg_2'><th>" . Dropdown::getDropdownName("glpi_plugin_genericobject_typefamilies", $_GET['id']) . "</th></tr>";
5858
foreach ($types as $type) {
5959
$itemtype = $type['itemtype'];
60-
echo "<tr class='tab_bg_1'><td align='center'>";
61-
echo "<a href='" . $itemtype::getSearchURL() . "'>";
62-
echo $itemtype::getTypeName();
63-
echo "</a></td></tr>";
60+
if (Session::haveRight(PluginGenericobjectProfile::getProfileNameForItemtype($itemtype), READ)) {
61+
echo "<tr class='tab_bg_1'><td align='center'>";
62+
echo "<a href='" . $itemtype::getSearchURL() . "'>";
63+
echo $itemtype::getTypeName();
64+
echo "</a></td></tr>";
65+
}
6466
}
6567
echo "</table>";
6668
}

0 commit comments

Comments
 (0)