summaryrefslogtreecommitdiffstats
path: root/EssentialsGroupManager
diff options
context:
space:
mode:
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);
}