diff options
author | ElgarL <ElgarL@Palmergames.com> | 2014-03-27 03:48:20 +0000 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2014-05-04 12:50:13 +0100 |
commit | f0947e9a7cf8c6478ab25944ff4c20c1f9010ee1 (patch) | |
tree | bb5bcb4a134ff9b3a4cda647c2a803b9fd0401fa /EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions | |
parent | 92bb4e0e6626aeeb574f7217de825b718cf14dac (diff) | |
download | Essentials-f0947e9a7cf8c6478ab25944ff4c20c1f9010ee1.tar Essentials-f0947e9a7cf8c6478ab25944ff4c20c1f9010ee1.tar.gz Essentials-f0947e9a7cf8c6478ab25944ff4c20c1f9010ee1.tar.lz Essentials-f0947e9a7cf8c6478ab25944ff4c20c1f9010ee1.tar.xz Essentials-f0947e9a7cf8c6478ab25944ff4c20c1f9010ee1.zip |
Fix manucheckp to understand and report correctly on Exception nodes.
Diffstat (limited to 'EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions')
-rw-r--r-- | EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java | 39 |
1 files changed, 28 insertions, 11 deletions
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java index 8f8f4c599..6eda3f1cc 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java @@ -898,32 +898,49 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { PermissionCheckResult resultUser = checkUserOnlyPermission(user, targetPermission); if (resultUser.resultType != PermissionCheckResult.Type.NOTFOUND) { + resultUser.accessLevel = targetPermission; - return resultUser; + + if (resultUser.resultType == PermissionCheckResult.Type.EXCEPTION) { + return resultUser; + } + + result = resultUser; + } - // IT ONLY CHECKS GROUPS PERMISSIONS IF RESULT FOR USER IS NOT FOUND + // IT ONLY CHECKS GROUPS PERMISSIONS IF RESULT FOR USER IS NOT AN EXCEPTION PermissionCheckResult resultGroup = checkGroupPermissionWithInheritance(user.getGroup(), targetPermission); if (resultGroup.resultType != PermissionCheckResult.Type.NOTFOUND) { + resultGroup.accessLevel = targetPermission; - return resultGroup; + + if (resultGroup.resultType == PermissionCheckResult.Type.EXCEPTION) { + return resultGroup; + } + + result = resultGroup; + } // SUBGROUPS CHECK for (Group subGroup : user.subGroupListCopy()) { - PermissionCheckResult resultSubGroup = checkGroupPermissionWithInheritance(subGroup, targetPermission); - + PermissionCheckResult resultSubGroup = checkGroupPermissionWithInheritance(subGroup, targetPermission); if (resultSubGroup.resultType != PermissionCheckResult.Type.NOTFOUND) { - 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; + resultSubGroup.accessLevel = targetPermission; + + if (resultSubGroup.resultType == PermissionCheckResult.Type.EXCEPTION) { + return resultSubGroup; + + } else if ((resultSubGroup.resultType == PermissionCheckResult.Type.FOUND) && (result.resultType != PermissionCheckResult.Type.NEGATION)) { + + result = resultSubGroup; + } else if (resultSubGroup.resultType == PermissionCheckResult.Type.NEGATION) { - resultSubGroup.accessLevel = targetPermission; + result = resultSubGroup; } |