mirror of
https://github.com/MilkBowl/Vault.git
synced 2024-11-27 13:07:23 +01:00
commit
532bee2930
@ -188,12 +188,18 @@ public class Permission_GroupManager extends Permission {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean playerInGroup(String worldName, String playerName, String groupName) {
|
public boolean playerInGroup(String worldName, String playerName, String groupName) {
|
||||||
return perms.inGroup(playerName, worldName);
|
return perms.inGroup(playerName, groupName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean playerAddGroup(String worldName, String playerName, String groupName) {
|
public boolean playerAddGroup(String worldName, String playerName, String groupName) {
|
||||||
OverloadedWorldHolder owh = groupManager.getWorldsHolder().getWorldData(worldName);
|
OverloadedWorldHolder owh;
|
||||||
|
if (worldName == null) {
|
||||||
|
owh = groupManager.getWorldsHolder().getWorldDataByPlayerName(playerName);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
owh = groupManager.getWorldsHolder().getWorldData(worldName);
|
||||||
|
}
|
||||||
if (owh == null) {
|
if (owh == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -207,6 +213,8 @@ public class Permission_GroupManager extends Permission {
|
|||||||
}
|
}
|
||||||
if (user.getGroup().equals(owh.getDefaultGroup())) {
|
if (user.getGroup().equals(owh.getDefaultGroup())) {
|
||||||
user.setGroup(group);
|
user.setGroup(group);
|
||||||
|
} else if (group.getInherits().contains(user.getGroup().getName().toLowerCase())) {
|
||||||
|
user.setGroup(group);
|
||||||
} else {
|
} else {
|
||||||
user.addSubGroup(group);
|
user.addSubGroup(group);
|
||||||
}
|
}
|
||||||
@ -215,7 +223,13 @@ public class Permission_GroupManager extends Permission {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean playerRemoveGroup(String worldName, String playerName, String groupName) {
|
public boolean playerRemoveGroup(String worldName, String playerName, String groupName) {
|
||||||
OverloadedWorldHolder owh = groupManager.getWorldsHolder().getWorldData(worldName);
|
OverloadedWorldHolder owh;
|
||||||
|
if (worldName == null) {
|
||||||
|
owh = groupManager.getWorldsHolder().getWorldDataByPlayerName(playerName);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
owh = groupManager.getWorldsHolder().getWorldData(worldName);
|
||||||
|
}
|
||||||
if (owh == null) {
|
if (owh == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user