Better permissions in plugin.yml (Many thanks to SpaceManiac for the help) (Fix to issue #55)

Removed isOp from permissions checks, no longer needed.
This commit is contained in:
NuclearW 2011-07-19 23:01:00 -04:00
parent ca009f3d22
commit dd3529eca1
2 changed files with 65 additions and 59 deletions

View File

@ -644,7 +644,7 @@ public class mcMMO extends JavaPlugin
/*
* FFS -> MySQL
*/
else if(label.equalsIgnoreCase("mmoupdate") && player.isOp())
else if(label.equalsIgnoreCase("mmoupdate"))
{
if(!mcPermissions.getInstance().admin(player))
{
@ -912,17 +912,6 @@ public class mcMMO extends JavaPlugin
player.sendMessage(mcLocale.getString("mcPlayerListener.GodModeEnabled"));
PP.toggleGodMode();
}
} else if (player.isOp())
{
if(PP.getGodMode())
{
player.sendMessage(mcLocale.getString("mcPlayerListener.GodModeDisabled"));
PP.toggleGodMode();
} else
{
player.sendMessage(mcLocale.getString("mcPlayerListener.GodModeEnabled"));
PP.toggleGodMode();
}
}
}
else if(LoadProperties.clearmyspawnEnable && LoadProperties.enableMySpawn && label.equalsIgnoreCase(LoadProperties.clearmyspawn) && mcPermissions.getInstance().mySpawn(player))
@ -1027,7 +1016,7 @@ public class mcMMO extends JavaPlugin
/*
* WHOIS COMMAND
*/
else if(LoadProperties.whoisEnable && label.equalsIgnoreCase(LoadProperties.whois) && (player.isOp() || mcPermissions.getInstance().whois(player))){
else if(LoadProperties.whoisEnable && label.equalsIgnoreCase(LoadProperties.whois) && mcPermissions.getInstance().whois(player)){
if(split.length < 2){
player.sendMessage(ChatColor.RED + "Proper usage is /"+LoadProperties.whois+" <playername>");
return true;
@ -1304,14 +1293,13 @@ public class mcMMO extends JavaPlugin
+ aMessage);
for (Player herp : getServer().getOnlinePlayers()) {
if ((herp.isOp() || mcPermissions.getInstance().adminChat(
herp)))
if (mcPermissions.getInstance().adminChat(herp))
herp.sendMessage(aPrefix + aMessage);
}
return true;
}
if(!mcPermissions.getInstance().adminChat(player) && !player.isOp()){
if(!mcPermissions.getInstance().adminChat(player)){
player.sendMessage(ChatColor.YELLOW+"[mcMMO]"+ChatColor.DARK_RED +mcLocale.getString("mcPlayerListener.NoPermission"));
return true;
}
@ -1329,8 +1317,7 @@ public class mcMMO extends JavaPlugin
log.log(Level.INFO, "[A]<" + player.getName() + "> "
+ aMessage);
for (Player herp : getServer().getOnlinePlayers()) {
if ((herp.isOp() || mcPermissions.getInstance().adminChat(
herp)))
if (mcPermissions.getInstance().adminChat(herp))
herp.sendMessage(aPrefix + aMessage);
}
return true;

View File

@ -68,18 +68,35 @@ permissions:
mcmmo.*:
description: Implies all mcmmo permissions.
children:
mcmmo.defaults: true
#Instead of containing mcmmo.defaultsop on its own, it should specify each of mcmmo.defaultsop
mcmmo.admin: true
mcmmo.tools.*: true
mcmmo.chat.adminchat: true
mcmmo.defaults:
default: true
description: mcmmo permisionss that default to true
children:
mcmmo.ability.*: true
mcmmo.item.*: true
mcmmo.tools.*: true
mcmmo.regeneration: true
mcmmo.motd: true
mcmmo.commands.*: true
mcmmo.chat.*: true
mcmmo.chat.partychat: true
mcmmo.skills.*: true
mcmmo.admin:
mcmmo.defaultsop:
default: op
description: mcmmo permissions that default to op
children:
mcmmo.admin: true
mcmmo.tools.*: true
mcmmo.chat.adminchat: true
mcmmo.admin:
description:
mcmmo.tools.*:
description: Implies all mcmmo.tools permissions.
@ -88,11 +105,11 @@ permissions:
mcmmo.tools.mmoedit: true
mcmmo.tools.mcgod: true
mcmmo.tools.mcrefresh:
default: op
description:
mcmmo.tools.mmoedit:
default: op
description:
mcmmo.tools.mcgod:
default: op
description:
mcmmo.ability.*:
description: Implies all mcmmo.ability permissions.
@ -105,32 +122,32 @@ permissions:
mcmmo.ability.swords: true
mcmmo.ability.woodcutting: true
mcmmo.ability.herbalism:
default: true
description:
mcmmo.ability.excavation:
default: true
description:
mcmmo.ability.unarmed:
default: true
description:
mcmmo.ability.mining:
default: true
description:
mcmmo.ability.axes:
default: true
description:
mcmmo.ability.swords:
default: true
description:
mcmmo.ability.woodcutting:
default: true
description:
mcmmo.item.*:
description: Implies all mcmmo.item permissions.
children:
mcmmo.item.chimaerawing: true
mcmmo.item.chimaerawing:
default: true
description:
mcmmo.regeneration:
default: true
description:
mcmmo.motd:
default: true
description:
mcmmo.commands.*:
description: Implies all mcmmo.commands permissions.
@ -142,17 +159,17 @@ permissions:
mcmmo.commands.whois: true
mcmmo.commands.party: true
mcmmo.commands.ability:
default: true
description:
mcmmo.commands.myspawn:
default: true
description:
mcmmo.commands.setmyspawn:
default: true
description:
mcmmo.commands.ptp:
default: true
description:
mcmmo.commands.whois:
default: true
description:
mcmmo.commands.party:
default: true
description:
mcmmo.chat.*:
description: Implies all mcmmo.chat permissions. (Warning, contains adminchat)
@ -160,9 +177,9 @@ permissions:
mcmmo.chat.adminchat: true
mcmmo.chat.partychat: true
mcmmo.chat.adminchat:
default: op
description:
mcmmo.chat.partychat:
default: true
description:
mcmmo.skills.*:
description: Implies all mcmmo.skills permissions.
@ -194,36 +211,38 @@ permissions:
mcmmo.skills.curative.heal.self: true
mcmmo.skills.sorcery:
default: true
description:
mcmmo.skills.sorcery.water:
default: true
description:
mcmmo.skills.sorcery.water.thunder:
default: true
description:
mcmmo.skills.curative:
default: true
description:
mcmmo.skills.curative.heal.other:
default: true
description:
mcmmo.skills.curative.heal.self:
default: true
description:
mcmmo.skills.taming:
default: true
description:
mcmmo.skills.mining:
default: true
description:
mcmmo.skills.woodcutting:
default: true
description:
mcmmo.skills.repair:
default: true
description:
mcmmo.skills.unarmed:
default: true
description:
mcmmo.skills.archery:
default: true
description:
mcmmo.skills.herbalism:
default: true
description:
mcmmo.skills.excavation:
default: true
description:
mcmmo.skills.swords:
default: true
description:
mcmmo.skills.axes:
default: true
description:
mcmmo.skills.acrobatics:
default: true
description: