restricted-commands have been removed from config.yml

Now we have a whitelist: player-commands
This commit is contained in:
snowleo 2011-07-16 04:05:43 +02:00
parent a8fdce257b
commit d9b88a83d1
4 changed files with 49 additions and 45 deletions

View File

@ -30,7 +30,8 @@ public class ConfigPermissionsHandler implements IPermissionsHandler
public boolean hasPermission(final Player base, final String node)
{
final String[] cmds = node.split("\\.", 2);
return !ess.getSettings().isCommandRestricted(cmds[cmds.length - 1]);
return !ess.getSettings().isCommandRestricted(cmds[cmds.length - 1])
&& ess.getSettings().isPlayerCommand(cmds[cmds.length - 1]);
}
public String getPrefix(final Player base)

View File

@ -126,4 +126,6 @@ public interface ISettings extends IConf
boolean removeGodOnDisconnect();
boolean changeDisplayName();
boolean isPlayerCommand(String string);
}

View File

@ -100,6 +100,17 @@ public class Settings implements ISettings
}
return config.getBoolean("restrict-" + label.toLowerCase(), false);
}
@Override
public boolean isPlayerCommand(String label)
{
for (String c : config.getStringList("player-commands", new ArrayList<String>(0)))
{
if (!c.equalsIgnoreCase(label)) continue;
return true;
}
return false;
}
@Override
public boolean isCommandOverridden(String name)

View File

@ -114,52 +114,42 @@ overridden-commands:
disabled-commands:
# - nick
# Restricted commands will only be available to ops.
# Restricted commands have been removed.
# Now we have a whitelist, all commands not on this list are only available to ops.
# These will have NO EFFECT if you have Permissions installed!
# These are here only if you want something simpler than Permissions.
restricted-commands:
- bigtree
- item
- give
- heal
- plugin
- time
- top
- tp
- tphere
- tree
- setspawn
- antioch
- kick
- ban
- unban
- top
- jump
- tpo
- tppos
- tpohere
- economy
- setwarp
- delwarp
- essentials
- gc
- spawnmob
- broadcast
- burn
- ext
- kill
- ping
- banip
- unban
- mute
- kick
- kickall
- unbanip
- togglejail
- setjail
- eco.loan
- teleport.timer.bypass
- teleport.cooldown.bypass
player-commands:
- afk
- back
- back.ondeath
- balance
- clearinventory
- compass
- help
- helpop
- home
- home.others
- ignore
- info
- list
- mail
- motd
- msg
- nick
- pay
- powertool
- r
- rules
- seen
- sell
- sethome
- suicide
- tpa
- tpaccept
- tpahere
- tpdeny
- world
- worth
# Note: All items MUST be followed by a quantity!
# Times are measured in seconds.