mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2024-09-12 05:08:48 +00:00
Properly fix inherited negated nodes.
This commit is contained in:
parent
7f269187c5
commit
9ff8b69282
|
@ -134,12 +134,13 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface {
|
||||||
groupPermArray = populatePerms(ph.getGroup(group).getPermissionList(), includeChildren);
|
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) {
|
for (String perm : groupPermArray) {
|
||||||
|
boolean negated = (perm.startsWith("-"));
|
||||||
// Perm doesn't already exists and there is no negation for it
|
// 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)
|
// or It's a negated perm where a normal perm doesn't exists (don't allow inheritance to negate higher perms)
|
||||||
if ((!playerPermArray.contains(perm)) && (!playerPermArray.contains("-" + perm))
|
if ((!negated && !playerPermArray.contains(perm) && !playerPermArray.contains("-" + perm))
|
||||||
&& (!perm.startsWith("-") && (!playerPermArray.contains(perm.substring(1)))))
|
|| (negated && !playerPermArray.contains(perm.substring(1))))
|
||||||
playerPermArray.add(perm);
|
playerPermArray.add(perm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue