mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-08 15:46:54 +02:00
Check subgroup permissions with an equal priority so no one subgroup is higher ranked than another.
This commit is contained in:
@@ -219,4 +219,5 @@ v 2.0:
|
|||||||
- Don't allow adding a node with '/manuaddp' and '/mangaddp' which is already negated.
|
- Don't allow adding a node with '/manuaddp' and '/mangaddp' which is already negated.
|
||||||
- Warn when adding a node where an exception already exist.
|
- 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).
|
- 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).
|
- 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.
|
@@ -849,13 +849,26 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface {
|
|||||||
// SUBGROUPS CHECK
|
// SUBGROUPS CHECK
|
||||||
for (Group subGroup : user.subGroupListCopy()) {
|
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.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
|
// THEN IT RETURNS A NOT FOUND
|
||||||
|
// OR THE RESULT OF THE SUBGROUP SEARCH.
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user