Do not process normal permissions for operators and owners

This commit is contained in:
Fabrizio La Rosa 2020-07-29 21:33:48 +02:00
parent 551af02570
commit 735f7cacd7
2 changed files with 11 additions and 3 deletions

View File

@ -725,7 +725,7 @@ public class Island {
public boolean hasPermission(IslandRole role, BasicPermission permission) {
if (islandPermissions.containsKey(role)) {
for (IslandPermission islandPermission : islandPermissions.get(role)) {
if (islandPermission.getPermission() == permission)
if (islandPermission.getPermission().equals(permission))
return islandPermission.getStatus();
}
}

View File

@ -238,11 +238,19 @@ public class PermissionManager {
switch(island.getRole(player)){
case Owner:
if(!configLoad.getBoolean("Island.Settings.OwnersAndOperatorsAsMembers", false)){
return island.hasPermission(IslandRole.Owner, permission);
if(permission.getType().equals(PermissionType.ISLAND)) {
return island.hasPermission(IslandRole.Owner, permission);
} else {
return true;
}
}
case Operator:
if(!configLoad.getBoolean("Island.Settings.OwnersAndOperatorsAsMembers", false)){
return island.hasPermission(IslandRole.Operator, permission);
if(permission.getType().equals(PermissionType.OPERATOR)) {
return island.hasPermission(IslandRole.Operator, permission);
} else {
return true;
}
}
case Member:
return island.hasPermission(IslandRole.Member, permission);