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

@@ -40,22 +40,11 @@ public class CmdSethome extends FCommand {
return;
}
Access access = faction.getAccess(fme, PermissableAction.SETHOME);
if (access == Access.DENY) {
fme.msg(TL.GENERIC_NOPERMISSION, "sethome");
return;
}
// If player does not have allow run extra permission checks
if (access != Access.ALLOW) {
if (faction == myFaction) {
if (!assertMinRole(Role.MODERATOR)) {
return;
}
} else {
if (!Permission.SETHOME_ANY.has(sender, true)) {
return;
}
if (!fme.isAdminBypassing()) {
Access access = myFaction.getAccess(fme, PermissableAction.SETHOME);
if (access != Access.ALLOW && fme.getRole() != Role.ADMIN && !Permission.SETHOME_ANY.has(sender, true)) {
fme.msg(TL.GENERIC_FPERM_NOPERMISSION, "set home");
return;
}
}