summaryrefslogtreecommitdiffstats
path: root/EssentialsGroupManager/src
diff options
context:
space:
mode:
authorElgarL <ElgarL@Palmergames.com>2013-05-22 10:37:24 +0100
committerKHobbits <rob@khobbits.co.uk>2014-05-04 12:50:02 +0100
commit28036b7d1793cf729badd6aa6dbc718f1c3581eb (patch)
treed5465e955419674a19e9869c8cb066663bf08ad4 /EssentialsGroupManager/src
parent721d5c2f5c6f1a496f4bd502f7babef2fbbd98c8 (diff)
downloadEssentials-28036b7d1793cf729badd6aa6dbc718f1c3581eb.tar
Essentials-28036b7d1793cf729badd6aa6dbc718f1c3581eb.tar.gz
Essentials-28036b7d1793cf729badd6aa6dbc718f1c3581eb.tar.lz
Essentials-28036b7d1793cf729badd6aa6dbc718f1c3581eb.tar.xz
Essentials-28036b7d1793cf729badd6aa6dbc718f1c3581eb.zip
Check subgroup permissions with an equal priority so no one subgroup is higher ranked than another.
Diffstat (limited to 'EssentialsGroupManager/src')
-rw-r--r--EssentialsGroupManager/src/Changelog.txt3
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java17
2 files changed, 17 insertions, 3 deletions
diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt
index f7c66782a..885aff9ca 100644
--- a/EssentialsGroupManager/src/Changelog.txt
+++ b/EssentialsGroupManager/src/Changelog.txt
@@ -219,4 +219,5 @@ v 2.0:
- Don't allow adding a node with '/manuaddp' and '/mangaddp' which is already negated.
- Warn when adding a node where an exception already exist.
- Only prevent adding nodes with '/manuaddp' and '/mangaddp' if they are exact matches (not wildcards).
- - Store worldSelection indexed on the senders name rather than the object (fixes commandblocks using manselect). \ No newline at end of file
+ - Store worldSelection indexed on the senders name rather than the object (fixes commandblocks using manselect).
+ - Check subgroup permissions with an equal priority so no one subgroup is higher ranked than another. \ 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 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;
}