Aligns permissions and fixes permission bugs

https://github.com/BentoBoxWorld/BSkyBlock/issues/120
This commit is contained in:
tastybento 2019-05-07 13:14:25 -07:00
parent 91034f956e
commit fc160d8c5f
8 changed files with 8 additions and 8 deletions

View File

@ -686,7 +686,7 @@ public abstract class CompositeCommand extends Command implements PluginIdentifi
* @return true if cool down in place, false if not * @return true if cool down in place, false if not
*/ */
protected boolean checkCooldown(User user, UUID targetUUID) { protected boolean checkCooldown(User user, UUID targetUUID) {
if (!cooldowns.containsKey(user.getUniqueId()) || user.isOp() || user.hasPermission(getPermissionPrefix() + ".mod.bypasscooldowns")) { if (!cooldowns.containsKey(user.getUniqueId()) || user.isOp() || user.hasPermission(getPermissionPrefix() + "mod.bypasscooldowns")) {
return false; return false;
} }
cooldowns.putIfAbsent(user.getUniqueId(), new HashMap<>()); cooldowns.putIfAbsent(user.getUniqueId(), new HashMap<>());

View File

@ -19,7 +19,7 @@ public class AdminInfoCommand extends CompositeCommand {
@Override @Override
public void setup() { public void setup() {
setPermission("admin.info"); setPermission("mod.info");
setOnlyPlayer(false); setOnlyPlayer(false);
setParametersHelp("commands.admin.info.parameters"); setParametersHelp("commands.admin.info.parameters");
setDescription("commands.admin.info.description"); setDescription("commands.admin.info.description");

View File

@ -19,7 +19,7 @@ public class AdminTeamAddCommand extends CompositeCommand {
@Override @Override
public void setup() { public void setup() {
setPermission("admin.team"); setPermission("mod.team");
setParametersHelp("commands.admin.team.add.parameters"); setParametersHelp("commands.admin.team.add.parameters");
setDescription("commands.admin.team.add.description"); setDescription("commands.admin.team.add.description");
} }

View File

@ -19,7 +19,7 @@ public class AdminTeamDisbandCommand extends CompositeCommand {
@Override @Override
public void setup() { public void setup() {
setPermission("admin.team"); setPermission("mod.team");
setParametersHelp("commands.admin.team.disband.parameters"); setParametersHelp("commands.admin.team.disband.parameters");
setDescription("commands.admin.team.disband.description"); setDescription("commands.admin.team.disband.description");
} }

View File

@ -24,7 +24,7 @@ public class AdminTeamKickCommand extends CompositeCommand {
@Override @Override
public void setup() { public void setup() {
setPermission("admin.team"); setPermission("mod.team");
setParametersHelp("commands.admin.team.kick.parameters"); setParametersHelp("commands.admin.team.kick.parameters");
setDescription("commands.admin.team.kick.description"); setDescription("commands.admin.team.kick.description");
} }

View File

@ -23,7 +23,7 @@ public class AdminTeamSetownerCommand extends CompositeCommand {
@Override @Override
public void setup() { public void setup() {
setPermission("admin.team"); setPermission("mod.team");
setParametersHelp("commands.admin.team.setowner.parameters"); setParametersHelp("commands.admin.team.setowner.parameters");
setDescription("commands.admin.team.setowner.description"); setDescription("commands.admin.team.setowner.description");
} }

View File

@ -74,7 +74,7 @@ public class IslandBanCommand extends CompositeCommand {
} }
User target = User.getInstance(targetUUID); User target = User.getInstance(targetUUID);
// Cannot ban ops // Cannot ban ops
if (target.hasPermission("admin.noban")) { if (target.hasPermission(getAddon().getPermissionPrefix() + "admin.noban")) {
user.sendMessage("commands.island.ban.cannot-ban"); user.sendMessage("commands.island.ban.cannot-ban");
return false; return false;
} }

View File

@ -82,7 +82,7 @@ public class IslandExpelCommand extends CompositeCommand {
return false; return false;
} }
// Cannot ban ops // Cannot ban ops
if (target.isOp() || target.hasPermission("admin.noexpel")) { if (target.isOp() || target.hasPermission("admin.noexpel") || target.hasPermission("mod.bypassexpel")) {
user.sendMessage(CANNOT_EXPEL); user.sendMessage(CANNOT_EXPEL);
return false; return false;
} }