Skip to content

Commit 601af36

Browse files
committed
Fixed possible NPE and added infoguide.view.GUIDENAME as an override permissions to hide. Also allowed InfoGuide.Admin to override all hide permissions.
Signed-off-by: mcsnetworks <mike@mcsnetworks.com>
1 parent 45ccf9d commit 601af36

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/main/java/net/dockter/infoguide/gui/GUIGuide.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,11 +322,19 @@ private void refreshItems() {
322322
List<String> items = new ArrayList<String>();
323323
for (String gguide : GuideManager.getLoadedGuides().keySet()) {
324324
if (player.hasPermission("infoguide.view." + gguide) || player.hasPermission("infoguide.view")) {
325-
items.add(gguide);
325+
items.add(gguide); // Add All Guides that are available to the user.
326326
}
327327
if (player.hasPermission("infoguide.hide." + gguide)) {
328-
items.remove(gguide);
328+
if (items.contains(gguide)) {
329+
items.remove(gguide); // Remove Specific Guides that are suppose to be hidden.
330+
}
329331
}
332+
if (player.hasPermission("infoguide.view." + gguide) || player.hasPermission("infoguide.admin")) {
333+
if (!items.contains(gguide)) {
334+
items.add(gguide); // Override inherited Hide Permissions
335+
}
336+
}
337+
330338

331339
}
332340
Collections.sort(items, String.CASE_INSENSITIVE_ORDER);

0 commit comments

Comments
 (0)