why would anyone use Bukkitpermissions ??

Discussion in 'Bukkit Discussion' started by goakiller900, Dec 2, 2011.

Thread Status:
Not open for further replies.
  1. I take my word backs

    we stepped over to PEX
     
  2. Offline

    NuclearW

    You realize there is no one plugin "BukkitPermissions" correct?

    BukkitPermissions is the name often given to the permissions API (more commonly called SuperPerms), which allows any plugin to use permissions without having to specifically hook into a plugin and support it. For a plugin developer, the permissions API is roughly the difference between this without it:

    Code:
    package some.plugin.packagename;
    
    import org.bukkit.entity.Player;
    import org.bukkit.plugin.Plugin;
    
    import com.nijikokun.bukkit.Permissions.Permissions;
    import org.anjocaido.groupmanager.GroupManager;
    import ru.tehkode.permissions.bukkit.PermissionsEx;
    
    public class pluginPermissionsHandler {
        private enum PermissionHandler {
            PEX, PERMISSIONS, GROUP_MANAGER, NONE
        }
        private static PermissionHandler handler;
        public static Plugin PermissionPlugin;
        private static Main plugin;
    
        public static void initialize(Main instance) {
            pluginPermissionsHandler.plugin = instance;
            Plugin PermissionsEx = plugin.getServer().getPluginManager().getPlugin("PermissionsEx");
            Plugin Permissions = plugin.getServer().getPluginManager().getPlugin("Permissions");
            Plugin GroupManager = plugin.getServer().getPluginManager().getPlugin("GroupManager");
            handler = PermissionHandler.NONE;
    
            if(PermissionsEx != null) {
                PermissionPlugin = PermissionsEx;
                handler = PermissionHandler.PEX;
                String version = PermissionPlugin.getDescription().getVersion();
                plugin.log.info("PermissionEx version " + version + " loaded.");
            } else if(Permissions != null) {
                PermissionPlugin = Permissions;
                handler = PermissionHandler.PERMISSIONS;
                String version = PermissionPlugin.getDescription().getVersion();
                plugin.log.info("Permissions version " + version + " loaded.");
            } else if(GroupManager != null) {
                PermissionPlugin = GroupManager;
                handler = PermissionHandler.GROUP_MANAGER;
                String version = PermissionPlugin.getDescription().getVersion();
                plugin.log.info("GroupManager version " + version + " loaded.");
            }
        }
    
        public static void onEnable(Plugin pluginEnabled) {
            if(PermissionPlugin == null) {
                String pluginName = plugin.getDescription().getName();
                handler = PermissionHandler.NONE;
    
                if(pluginName.equals("PermissionsEx")) {
                    PermissionPlugin = pluginEnabled;
                    handler = PermissionHandler.PEX;
                    String version = pluginEnabled.getDescription().getVersion();
                    plugin.log.info("PermissionEx version " + version + " loaded.");
                } else if(pluginName.equals("Permissions")) {
                    PermissionPlugin = pluginEnabled;
                    handler = PermissionHandler.PERMISSIONS;
                    String version = pluginEnabled.getDescription().getVersion();
                    plugin.log.info("Permissions version " + version + " loaded.");
                } else if(pluginName.equals("GroupManager")) {
                    PermissionPlugin = pluginEnabled;
                    handler = PermissionHandler.GROUP_MANAGER;
                    String version = pluginEnabled.getDescription().getVersion();
                    plugin.log.info("GroupManager version " + version + " loaded.");
                }
            }
        }
    
        public static boolean has(Player player, String permission) {
            switch (handler) {
                case PEX:
                    return PermissionsEx.getPermissionManager().has(player, permission, player.getWorld().getName());
                case PERMISSIONS:
                    return ((Permissions) PermissionPlugin).getHandler().has(player, permission);
                case GROUP_MANAGER:
                    return ((GroupManager) PermissionPlugin).getWorldsHolder().getWorldPermissions(player).has(player, permission);
                case NONE:
                    return player.isOp();
                default:
                    return player.isOp();
            }
        }
    }
    And this with it:
    Code:
    player.hasPermission("some.permission")


    Chances are you just need to find a permissions plugin that supports the SuperPerms, and use plugins that are up to date and supports SuperPerms and you will be fine. It sounds to me like you're having trouble with one specific one.

    And no, no prefixing in the API, it's a permissions API, not a prefixing API.

    I suggest you look at getting bPermissions or PermissionsEx, those are the two most commonly used SuperPerms compatible plugins out there.
     
  3. Offline

    Tarheels

    Its all your opinion people like it and if you dont then use another plugin for permissions.
     
  4. Offline

    Evenprime

    You can use PermissionsEx, bPermissions or Essentials GroupManager instead. All of them support SuperPerms, and all of them have their own strength and weaknesses, depending on what you want. And especially all of them are uptodate and more than capable of replacing Permissions 3.x.
     
  5. Offline

    tincopper2

    I don't get it, I use groupmanager, and I posted this on MobArena but apparently grabagemule is having a little conniption and being a little bit oversensitive over where people cross the line on disrespectful or not, so I was trying to ask; is groupmanager just the perm manager, and superperms is what groupmanager? Because the only permissions type that works with mob arena would be superperms, which is what he said, and removing the join perm for joining mob arena from the creative world isn't working, peoples inventories are copied from creative into survival, which makes it so in 2 minutes users may retrieve a full inventory of diamond blocks/etc, and bring it back to survival, making the users unable to join mob arena from this world will easily set the flow of mob arena to work again, so I remove the perm mobarena.* by adding -mobarena.* to the permissions file for 'Creton' (creative world), and users are STILL able to join mob arena games, please help! -tin
     
Thread Status:
Not open for further replies.

Share This Page