Explicit permission checks and more admin bypasses

This commit is contained in:
Svenja Reissaus
2018-08-02 14:55:21 -03:00
parent 85de278dc9
commit 5fe55afc68
18 changed files with 105 additions and 101 deletions

View File

@@ -44,16 +44,13 @@ public class CmdDisband extends FCommand {
boolean isMyFaction = fme != null && faction == myFaction;
if (isMyFaction) {
if (!assertMinRole(Role.ADMIN)) {
return;
}
} else {
if (!Permission.DISBAND_ANY.has(sender, true)) {
if (!fme.isAdminBypassing()) {
Access access = myFaction.getAccess(fme, PermissableAction.DISBAND);
if (access != Access.ALLOW && fme.getRole() != Role.ADMIN) {
fme.msg(TL.GENERIC_FPERM_NOPERMISSION, "disband faction");
return;
}
}
if (!faction.isNormal()) {
msg(TL.COMMAND_DISBAND_IMMUTABLE.toString());
return;