Update to support newly available built-in Bukkit "superperms" permission system, though it will still use the Permissions plugin instead if that's available

Updated Bukkit JAR
Added LocalAreaChat plugin to the softdepend list so it's loaded first
This commit is contained in:
Brettflan 2011-07-18 11:46:14 -05:00
parent 2730fa1253
commit 19176ada2f
3 changed files with 60 additions and 19 deletions

Binary file not shown.

View File

@ -268,56 +268,52 @@ public class Factions extends JavaPlugin {
// -------------------------------------------- //
public static boolean hasPermParticipate(CommandSender sender) {
return hasPerm(sender, "factions.participate", false);
return hasPerm(sender, "factions.participate");
}
public static boolean hasPermCreate(CommandSender sender) {
return hasPerm(sender, "factions.create", false);
return hasPerm(sender, "factions.create");
}
public static boolean hasPermManageSafeZone(CommandSender sender) {
return hasPerm(sender, "factions.manageSafeZone", true);
return hasPerm(sender, "factions.manageSafeZone");
}
public static boolean hasPermManageWarZone(CommandSender sender) {
return hasPerm(sender, "factions.manageWarZone", true);
return hasPerm(sender, "factions.manageWarZone");
}
public static boolean hasPermAdminBypass(CommandSender sender) {
return hasPerm(sender, "factions.adminBypass", true);
return hasPerm(sender, "factions.adminBypass");
}
public static boolean hasPermReload(CommandSender sender) {
return hasPerm(sender, "factions.reload", true);
return hasPerm(sender, "factions.reload");
}
public static boolean hasPermSaveAll(CommandSender sender) {
return hasPerm(sender, "factions.saveall", true);
return hasPerm(sender, "factions.saveall");
}
public static boolean hasPermLock(CommandSender sender) {
return hasPerm(sender, "factions.lock", true);
return hasPerm(sender, "factions.lock");
}
public static boolean hasPermDisband(CommandSender sender) {
return hasPerm(sender, "factions.disband", true);
return hasPerm(sender, "factions.disband");
}
public static boolean hasPermWorlds(CommandSender sender) {
return hasPerm(sender, "factions.worldOptions", true);
return hasPerm(sender, "factions.worldOptions");
}
private static boolean hasPerm(CommandSender sender, String permNode, boolean fallbackOnlyOp) {
private static boolean hasPerm(CommandSender sender, String permNode) {
if (Factions.Permissions == null || ! (sender instanceof Player)) {
return fallbackOnlyOp == false || sender.isOp();
return sender.isOp() || sender.hasPermission(permNode);
}
if (sender instanceof Player) {
Player player = (Player)sender;
return Factions.Permissions.has(player, permNode);
}
return false;
Player player = (Player)sender;
return Factions.Permissions.has(player, permNode);
}
// -------------------------------------------- //

View File

@ -7,7 +7,52 @@ softdepend:
- EssentialsChat
- HeroChat
- iChat
- LocalAreaChat
commands:
f:
description: All of the Factions commands
usage: See documentation.
permissions:
factions.*:
description: Grants all Factions permissions
children:
factions.participate: true
factions.create: true
factions.manageSafeZone: true
factions.manageWarZone: true
factions.adminBypass: true
factions.reload: true
factions.saveall: true
factions.lock: true
factions.disband: true
factions.worldOptions: true
factions.participate:
description: Allows the player to participate in a faction
default: true
factions.create:
description: Allows the player to create a new faction
default: true
factions.manageSafeZone:
description: Allows the player to claim land as a safe zone, and to build/destroy within safe zones
default: op
factions.manageWarZone:
description: Allows the player to claim land as a war zone, and to build/destroy within war zones
default: op
factions.adminBypass:
description: Allows the player to bypass many normal restrictions, and use the bypass command
default: op
factions.reload:
description: Can use the /f reload command to reload data file(s) from disk
default: op
factions.saveall:
description: Can use the /f saveall command to save all data to disk
default: op
factions.lock:
description: Can use the /f lock [on/off] command to temporarily lock the data files from being overwritten
default: op
factions.disband:
description: Can use the /f disband <faction> command to disband any faction
default: op
factions.worldOptions:
description: Can use the /f worldnoclaim and /f worldnopowerloss commands
default: op