WIP: Access method for commands

This commit is contained in:
Svenja Reissaus
2018-08-21 15:02:16 -03:00
parent 94c4ee815a
commit 9c6cc187f2
21 changed files with 111 additions and 66 deletions

View File

@@ -49,12 +49,9 @@ public class CmdHome extends FCommand {
fme.msg(TL.COMMAND_HOME_TELEPORTDISABLED);
return;
}
if (!fme.isAdminBypassing()) {
Access access = myFaction.getAccess(fme, PermissableAction.HOME);
if (access != Access.ALLOW && fme.getRole() != Role.ADMIN) {
fme.msg(TL.GENERIC_FPERM_NOPERMISSION, "teleport home");
return;
}
if (!this.hasAccess(PermissableAction.HOME)) {
fme.msg(TL.GENERIC_FPERM_NOPERMISSION, "teleport home");
return;
}