Skip to content

Commit

Permalink
Fix(Core): Hide items without proper user access rights in the fami…
Browse files Browse the repository at this point in the history
…ly 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]>
  • Loading branch information
ciberfred and stonebuzz authored Nov 28, 2024
1 parent a6fcbb5 commit 53a2dcc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

### Fixed

- Hide `items` without proper user access rights in the family list.

## [2.14.10] - 2024-09-06

### Fixed
Expand Down
10 changes: 6 additions & 4 deletions front/familylist.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,12 @@
echo "<tr class='tab_bg_2'><th>" . Dropdown::getDropdownName("glpi_plugin_genericobject_typefamilies", $_GET['id']) . "</th></tr>";
foreach ($types as $type) {
$itemtype = $type['itemtype'];
echo "<tr class='tab_bg_1'><td align='center'>";
echo "<a href='" . $itemtype::getSearchURL() . "'>";
echo $itemtype::getTypeName();
echo "</a></td></tr>";
if (Session::haveRight(PluginGenericobjectProfile::getProfileNameForItemtype($itemtype), READ)) {
echo "<tr class='tab_bg_1'><td align='center'>";
echo "<a href='" . $itemtype::getSearchURL() . "'>";
echo $itemtype::getTypeName();
echo "</a></td></tr>";
}
}
echo "</table>";
}
Expand Down

0 comments on commit 53a2dcc

Please sign in to comment.