Remove permissions support

This commit is contained in:
Steven Scott 2013-03-10 14:07:38 -07:00
parent 5d28fab1d2
commit 6c044ec82e
3 changed files with 18 additions and 53 deletions

12
README
View File

@ -15,9 +15,9 @@ iConomy support added back in, only costs are create, destroy and use.
Permissions
=============
stargate.use -- Allow use of all gates linking to any world in any network (Override ALL network/world permissions. Set to false to use network/world specific permissions)
stargate.world -- Allow use of gates linking to any world (For Permissions 2.x/3.x please use stargate.world.*)
stargate.world -- Allow use of gates linking to any world
stargate.world.{world} -- Allow use of gates with a destination in {world}. Set to false to disallow use.
stargate.network -- Allow use of gates on all networks (For Permissions 2.x/3.x please use stargate.network.*)
stargate.network -- Allow use of gates on all networks
stargate.network.{network} -- Allow use of all gates in {network}. Set to false to disallow use.
stargate.option -- Allow use of all options
@ -32,14 +32,14 @@ stargate.option -- Allow use of all options
stargate.create -- Allow creating gates on any network (Override all create permissions)
stargate.create.personal -- Allow creating gates on network {playername}
stargate.create.network -- Allow creating gates on any network (For Permissions 2.x/3.x please use stargate.create.network.*)
stargate.create.network -- Allow creating gates on any network
stargate.create.network.{networkname} -- Allow creating gates on network {networkname}. Set to false to disallow creation on {networkname}
stargate.create.gate -- Allow creation of any gate layout (For Permissions 2.x/3.x please use stargate.create.gate.*)
stargate.create.gate -- Allow creation of any gate layout
stargate.create.gate.{gatefile} -- Allow creation of only {gatefile} gates
stargate.destroy -- Allow destruction gates on any network (Orderride all destroy permissions)
stargate.destroy.personal -- Allow destruction of gates owned by user only
stargate.destroy.network -- Allow destruction of gates on any network (For Permissions 2.x/3.x please use stargate.destroy.network.*)
stargate.destroy.network -- Allow destruction of gates on any network
stargate.destroy.network.{networkname} -- Allow destruction of gates on network {networkname}. Set to false to disallow destruction of {networkname}
stargate.free -- Allow free use/creation/destruction of gates
@ -215,6 +215,8 @@ Bukkit Issue: Stargate will randomly NPE when drawing a sign. Long-standing Bukk
=============
Changes
=============
[Version 0.7.9.9]
- Remove "Permissions" support, we now only support SuperPerms handlers.
[Version 0.7.9.8]
- Make sure buttons stay where they should
[Version 0.7.9.7]

View File

@ -58,9 +58,6 @@ import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;
// Permissions
import com.nijikokun.bukkit.Permissions.Permissions;
/**
* Stargate - A portal plugin for Bukkit
* Copyright (C) 2011 Shaun (sturmeh)
@ -83,9 +80,6 @@ import com.nijikokun.bukkit.Permissions.Permissions;
@SuppressWarnings("unused")
public class Stargate extends JavaPlugin {
// Permissions
private static Permissions permissions = null;
public static Logger log;
private FileConfiguration newConfig;
private PluginManager pm;
@ -169,12 +163,7 @@ public class Stargate extends JavaPlugin {
this.migrate();
this.reloadGates();
// Check to see if iConomy/Permissions is loaded yet.
permissions = (Permissions)checkPlugin("Permissions");
if (permissions != null && (permissions.getDescription().getVersion().equals("2.7.2") || permissions.getDescription().getVersion().equals("2.7.7"))) {
log.info("[Stargate] Permissions is 2.7.2/2.7.7, most likely a bridge, disabling.");
permissions = null;
}
// Check to see if iConomy is loaded yet.
if (iConomyHandler.setupeConomy(pm)) {
if (iConomyHandler.register != null)
log.info("[Stargate] Register v" + iConomyHandler.register.getDescription().getVersion() + " found");
@ -381,15 +370,9 @@ public class Stargate extends JavaPlugin {
* Check whether the player has the given permissions.
*/
public static boolean hasPerm(Player player, String perm) {
if (permissions != null) {
if (permDebug)
Stargate.debug("hasPerm::Permissions(" + player.getName() + ")", perm + " => " + permissions.getHandler().has(player, perm));
return permissions.getHandler().has(player, perm);
} else {
if (permDebug)
Stargate.debug("hasPerm::SuperPerm(" + player.getName() + ")", perm + " => " + player.hasPermission(perm));
return player.hasPermission(perm);
}
if (permDebug)
Stargate.debug("hasPerm::SuperPerm(" + player.getName() + ")", perm + " => " + player.hasPermission(perm));
return player.hasPermission(perm);
}
/*
@ -399,20 +382,14 @@ public class Stargate extends JavaPlugin {
* Or the value of the node if it is
*/
public static boolean hasPermDeep(Player player, String perm) {
if (permissions != null) {
if (!player.isPermissionSet(perm)) {
if (permDebug)
Stargate.debug("hasPermDeep::Permissions", perm + " => " + permissions.getHandler().has(player, perm));
return permissions.getHandler().has(player, perm);
} else {
if (!player.isPermissionSet(perm)) {
if (permDebug)
Stargate.debug("hasPermDeep::SuperPerm", perm + " => true");
return true;
}
if (permDebug)
Stargate.debug("hasPermDeep::SuperPerms", perm + " => " + player.hasPermission(perm));
return player.hasPermission(perm);
Stargate.debug("hasPermDeep::SuperPerm", perm + " => true");
return true;
}
if (permDebug)
Stargate.debug("hasPermDeep::SuperPerms", perm + " => " + player.hasPermission(perm));
return player.hasPermission(perm);
}
/*
@ -1303,16 +1280,6 @@ public class Stargate extends JavaPlugin {
if (iConomyHandler.setupVault(event.getPlugin())) {
log.info("[Stargate] Vault v" + iConomyHandler.vault.getDescription().getVersion() + " found");
}
if (permissions == null) {
PluginDescriptionFile desc = event.getPlugin().getDescription();
if (desc.getName().equalsIgnoreCase("Permissions")) {
if (desc.getVersion().equals("2.7.2") || desc.getVersion().equals("2.7.7")) {
log.info("[Stargate] Permissions is 2.7.2/2.7.7, most likely a bridge, disabling.");
return;
}
permissions = (Permissions)checkPlugin(event.getPlugin());
}
}
}
@EventHandler
@ -1320,10 +1287,6 @@ public class Stargate extends JavaPlugin {
if (iConomyHandler.checkLost(event.getPlugin())) {
log.info("[Stargate] Register/Vault plugin lost.");
}
if (event.getPlugin() == permissions) {
log.info("[Stargate] Permissions plugin lost.");
permissions = null;
}
}
}

View File

@ -1,6 +1,6 @@
name: Stargate
main: net.TheDgtl.Stargate.Stargate
version: 0.7.9.8
version: 0.7.9.9
description: Stargate mod for Bukkit
author: Drakia
website: http://www.thedgtl.net