promotional bannermobile promotional banner

PermissionHelper

Abandoned
Support all permission plugins by supporting one!

PermissionHelper is designed to help developers support all permission plugins without forcing them to write separate methods for each one of them. It automaticlly hooks into any permission plugin when its enabled, itll work even if no permission plugin is found (defaulting to superperms). You can also get a list of groups a user is a member of or get a list of all groups.

Currently supports bPermissions, Permissions, PermissionsBukkit and PermissionsEx! (Some methods will return null if the permission plugin doesnt support it or isnt found)

How to hook into PermissionHelper (after adding PermissionHelper.jar to the build path):
import com.vildaberper.PermissionHelper.PermissionHelper;

public class MyPlugin extends JavaPlugin{
public static PermissionHelper ph;

@Override
public void onEnable(){
if(getServer().getPluginManager().getPlugin("PermissionHelper") != null && getServer().getPluginManager().getPlugin("PermissionHelper").isEnabled()){
MyPlugin.ph = (PermissionHelper) Bukkit.getPluginManager().getPlugin("PermissionHelper");
}
}
}


How to check if a player has permission:
if(MyPlugin.ph.hasPermission(player.getWorld().getName(), player, "myplugin.some.node")){
User has permission
}else{
Nope.avi
}


How to get all groups:
(you have to cast the object if you need it as Group, String or PermissionGroup)
List<Object> groups = MyPlugin.ph.getAllGroups(world.getName());


How to get all groups as strings (only the names):
List<String> groups = MyPlugin.ph.getAllGroupsString(world.getName());


You can also get the groups a user is a member of:
List<Object> groups = MyPlugin.ph.getAllGroups(world.getName(), player.getName());

and

List<String> groups = MyPlugin.ph.getAllGroupsString(world.getName(), player.getName());


How to get the permission plugin that PermissionHelper is hooked into (will return null if no permission plugin was found):
Plugin plugin = MyPlugin.ph.getPlugin();

The PermissionHelper Team

profile avatar
  • 3
    Projects
  • 29.4K
    Downloads

More from _ForgeUser6995008

  • DefaultCommands project image

    DefaultCommands

    • 4.8K
    • Bukkit Plugins

    The only plugin you'll ever need!

    • 4.8K
    • December 19, 2012
    • Bukkit Plugins
    • +4
  • God Tools project image

    God Tools

    • 0
    • Bukkit Plugins

    A way to get those tools with the highest enchantments possible!

    • 0
    • May 26, 2012
    • Bukkit Plugins
    • +2
  • LookUp project image

    LookUp

    • 547
    • Bukkit Plugins

    Better stair and slab placement!

    • 547
    • March 10, 2012
    • Bukkit Plugins
  • DefaultCommands project image

    DefaultCommands

    • 4.8K
    • Bukkit Plugins

    The only plugin you'll ever need!

    • 4.8K
    • December 19, 2012
    • Bukkit Plugins
    • +4
  • God Tools project image

    God Tools

    • 0
    • Bukkit Plugins

    A way to get those tools with the highest enchantments possible!

    • 0
    • May 26, 2012
    • Bukkit Plugins
    • +2
  • LookUp project image

    LookUp

    • 547
    • Bukkit Plugins

    Better stair and slab placement!

    • 547
    • March 10, 2012
    • Bukkit Plugins