added player-specific permission addition/removal to bPerms API

This commit is contained in:
Sleaker 2011-11-21 10:35:25 -08:00
parent ab123016ed
commit 1cdc84a0e3

View File

@ -91,12 +91,28 @@ public class Permission_bPermissions extends Permission {
@Override
public boolean playerAdd(String world, String player, String permission) {
throw new UnsupportedOperationException("Player specific permissions are not supported!");
if (world == null)
return false;
PermissionSet set = perms.getPermissionSet(world);
if (set == null)
return false;
set.addGroup(player, "p:" + permission);
return true;
}
@Override
public boolean playerRemove(String world, String player, String permission) {
throw new UnsupportedOperationException("Player specific permissions are not supported!");
if (world == null)
return false;
PermissionSet set = perms.getPermissionSet(world);
if (set == null)
return false;
set.removeGroup(player, "p:" + permission);
return true;
}
// use superclass implementation of playerAddTransient() and playerRemoveTransient()