diff options
author | ElgarL <ElgarL@Palmergames.com> | 2013-05-22 10:37:24 +0100 |
---|---|---|
committer | ElgarL <ElgarL@Palmergames.com> | 2013-05-22 10:37:24 +0100 |
commit | 4da70254ff8295c7bfb4f5c9d573edb881ccc134 (patch) | |
tree | 257c6952203c854d80e365dbb41694e8185ae095 /EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions | |
parent | e8c2a9792fee47895657ac1e445320be124802c4 (diff) | |
download | Essentials-4da70254ff8295c7bfb4f5c9d573edb881ccc134.tar Essentials-4da70254ff8295c7bfb4f5c9d573edb881ccc134.tar.gz Essentials-4da70254ff8295c7bfb4f5c9d573edb881ccc134.tar.lz Essentials-4da70254ff8295c7bfb4f5c9d573edb881ccc134.tar.xz Essentials-4da70254ff8295c7bfb4f5c9d573edb881ccc134.zip |
Check subgroup permissions with an equal priority so no one subgroup is higher ranked than another.
Diffstat (limited to 'EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions')
-rw-r--r-- | EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java index bef2fb713..3a6adee2e 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java @@ -849,13 +849,26 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { // SUBGROUPS CHECK for (Group subGroup : user.subGroupListCopy()) { PermissionCheckResult resultSubGroup = checkGroupPermissionWithInheritance(subGroup, targetPermission); + + if (resultSubGroup.resultType != PermissionCheckResult.Type.NOTFOUND) { - resultSubGroup.accessLevel = targetPermission; - return resultSubGroup; + + if ((resultSubGroup.resultType == PermissionCheckResult.Type.FOUND) && (result.resultType != PermissionCheckResult.Type.NEGATION)) { + resultSubGroup.accessLevel = targetPermission; + result = resultSubGroup; + } else if (resultSubGroup.resultType == PermissionCheckResult.Type.EXCEPTION) { + resultSubGroup.accessLevel = targetPermission; + return resultSubGroup; + } else if (resultSubGroup.resultType == PermissionCheckResult.Type.NEGATION) { + resultSubGroup.accessLevel = targetPermission; + result = resultSubGroup; + } + } } // THEN IT RETURNS A NOT FOUND + // OR THE RESULT OF THE SUBGROUP SEARCH. return result; } |