Revert "WIP: Access method for commands"

This reverts commit 9c6cc187f2.
This commit is contained in:
ProSavage
2018-09-08 17:28:09 -05:00
parent 9a773702eb
commit 90ae1822bc
21 changed files with 66 additions and 111 deletions

View File

@@ -5,8 +5,6 @@ import com.massivecraft.factions.integration.Econ;
import com.massivecraft.factions.struct.Role;
import com.massivecraft.factions.util.WarmUpUtil;
import com.massivecraft.factions.zcore.MCommand;
import com.massivecraft.factions.zcore.fperms.Access;
import com.massivecraft.factions.zcore.fperms.PermissableAction;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@@ -27,7 +25,6 @@ public abstract class FCommand extends MCommand<P> {
public boolean senderMustBeModerator;
public boolean senderMustBeAdmin;
public boolean senderMustBeColeader;
protected PermissableAction actionPermission;
public boolean isMoneyCommand;
@@ -46,47 +43,6 @@ public abstract class FCommand extends MCommand<P> {
senderMustBeAdmin = false;
}
public boolean hasAccess() {
if (this.permission == null || this.fme == null) return false;
if (!this.fme.isAdminBypassing()) {
Access access = myFaction.getAccess(this.fme, permission);
if (access != Access.ALLOW && this.fme.getRole() != Role.ADMIN) {
return false;
}
}
return true;
}
public boolean hasAccess(boolean isAdmin) {
if (this.actionPermission == null || this.fme == null) return false;
if (!this.fme.isAdminBypassing() && isAdmin) {
Access access = myFaction.getAccess(this.fme, this.actionPermission);
if (access != Access.ALLOW && this.fme.getRole() != Role.ADMIN) {
return false;
}
}
return true;
}
public boolean hasAccess(PermissableAction perm) {
if (this.permission == null || this.fme == null) return false;
if (!this.fme.isAdminBypassing()) {
Access access = myFaction.getAccess(this.fme, perm);
if (access != Access.ALLOW && this.fme.getRole() != Role.ADMIN) {
return false;
}
}
return true;
}
public boolean hasAccess(PermissableAction perm, boolean isAdmin) {
if (this.permission == null || this.fme == null) return false;
if (!this.fme.isAdminBypassing() && isAdmin) {
Access access = myFaction.getAccess(this.fme, perm);
if (access != Access.ALLOW && this.fme.getRole() != Role.ADMIN) {
return false;
}
}
return true;
}
@Override
public void execute(CommandSender sender, List<String> args, List<MCommand<?>> commandChain) {
if (sender instanceof Player) {