summaryrefslogtreecommitdiffstats
path: root/EssentialsGroupManager
diff options
context:
space:
mode:
authorElgarL <ElgarL@palmergames.com>2012-01-27 13:09:11 +0000
committerElgarL <ElgarL@palmergames.com>2012-01-27 13:09:11 +0000
commit9ff8b69282a872dc2504cf3de285198260bb3239 (patch)
tree752e3067bb49db46418e072fed68d12b30370f2d /EssentialsGroupManager
parent7f269187c5081c6a2f17baaffa8f2955b9547b99 (diff)
downloadEssentials-9ff8b69282a872dc2504cf3de285198260bb3239.tar
Essentials-9ff8b69282a872dc2504cf3de285198260bb3239.tar.gz
Essentials-9ff8b69282a872dc2504cf3de285198260bb3239.tar.lz
Essentials-9ff8b69282a872dc2504cf3de285198260bb3239.tar.xz
Essentials-9ff8b69282a872dc2504cf3de285198260bb3239.zip
Properly fix inherited negated nodes.
Diffstat (limited to 'EssentialsGroupManager')
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java
index 429a9553f..002558968 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java
@@ -134,12 +134,13 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface {
groupPermArray = populatePerms(ph.getGroup(group).getPermissionList(), includeChildren);
}
- // Add all group permissions, unless negated by direct player perms.
+ // Add all group permissions, unless negated by earlier permissions.
for (String perm : groupPermArray) {
+ boolean negated = (perm.startsWith("-"));
// Perm doesn't already exists and there is no negation for it
- // It's not a negated perm where a normal perm exists (don't allow inheritance to negate higher perms)
- if ((!playerPermArray.contains(perm)) && (!playerPermArray.contains("-" + perm))
- && (!perm.startsWith("-") && (!playerPermArray.contains(perm.substring(1)))))
+ // or It's a negated perm where a normal perm doesn't exists (don't allow inheritance to negate higher perms)
+ if ((!negated && !playerPermArray.contains(perm) && !playerPermArray.contains("-" + perm))
+ || (negated && !playerPermArray.contains(perm.substring(1))))
playerPermArray.add(perm);
}