t3hk0d3/PermissionsEx — Issue #124: Different permission values (Superperms/Permissions/PEX)
Author: hubertnnn
Created: 2011-11-11 23:45:36+00:00
State: open

I found some problems with attachements that works in some plugins and didnt work for others. After some reserch i found that:
1. Using Superperms, attachements works OK
2. Using PEX hook, attachements dont work
3. Using Permissions(bridge) hook, attachements dont work too

Example code:

Player p = ...;

PermissionAttachment attachment = p.addAttachment(plugin);
attachment.setPermission("tests.test", testing);

if(p.hasPermission("tests.test")) System.out.println("SuperPerms: accepted");
else System.out.println("SuperPerms: fail");

PermissionManager pexPM = PermissionsEx.getPermissionManager();
if(pexPM.has(p,"tests.test")) System.out.println("PEX: accepted");
else System.out.println("PEX: fail");

Permissions perm = (Permissions) plugin.getServer().getPluginManager().getPlugin("Permissions");
if(perm.getHandler().has(p, "tests.test")) System.out.println("Permissions: accepted");
else System.out.println("Permissions: fail");

attachment.unsetPermission("tests.test");

Shows following lines in console:

SuperPerms: accepted
PEX: fail
Permissions: fail

This mean that older plugins that dont use SuperPerms will fail with PEX.