diff options
author | ElgarL <ElgarL@palmergames.com> | 2012-01-27 12:38:00 +0000 |
---|---|---|
committer | ElgarL <ElgarL@palmergames.com> | 2012-01-27 12:38:00 +0000 |
commit | 7f269187c5081c6a2f17baaffa8f2955b9547b99 (patch) | |
tree | 8697dd2c08efff42e85ac5f838c1db8cba2dd956 | |
parent | 746eb353a2f9ef0b75406d8afc0dc7cef2b7766b (diff) | |
download | Essentials-7f269187c5081c6a2f17baaffa8f2955b9547b99.tar Essentials-7f269187c5081c6a2f17baaffa8f2955b9547b99.tar.gz Essentials-7f269187c5081c6a2f17baaffa8f2955b9547b99.tar.lz Essentials-7f269187c5081c6a2f17baaffa8f2955b9547b99.tar.xz Essentials-7f269187c5081c6a2f17baaffa8f2955b9547b99.zip |
do not allow inherited permissions to negate higher perms.
-rw-r--r-- | EssentialsGroupManager/src/Changelog.txt | 3 | ||||
-rw-r--r-- | EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java | 8 |
2 files changed, 8 insertions, 3 deletions
diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index 5155d6181..224f2763c 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -122,4 +122,5 @@ v 1.9: - Fixed subgroups (I broke earlier).
- Check for a null player object in the PlayerTeleportEvent.
- Trap errors in fetching the mirrors map.
- - Fixed an infinite loop error when using '/manudel' on a logged in player. It caused setDefaultGroup to trigger a bukkit update when no GM User existed yet.
\ No newline at end of file + - Fixed an infinite loop error when using '/manudel' on a logged in player. It caused setDefaultGroup to trigger a bukkit update when no GM User existed yet.
+ - do not allow inherited permissions to negate higher perms.
\ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java index de42ce9c3..429a9553f 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java @@ -135,9 +135,13 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { } // Add all group permissions, unless negated by direct player perms. - for (String perm : groupPermArray) - if ((!playerPermArray.contains(perm)) && (!playerPermArray.contains("-" + perm))) + for (String perm : groupPermArray) { + // 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))))) playerPermArray.add(perm); + } } // Collections.sort(playerPermArray, |