Loop into player permission

Hello,
I need to run a loop into all player permissions but i didnt find a way to get.

I need to get a number in permissions to define the limit of blocks a player can build, and i dont have the whole permissions name.

I using this code:

Map<Set<Context>, Map<String, Boolean>> perms = p.getSubjectData().getAllPermissions(); for (Set<Context> context:perms.keySet()){ RedProtect.logger.severe("Context: "+context.toString()); for (String perm:perms.get(context).keySet()){ RedProtect.logger.severe("block perm: "+perm); if (perm.startsWith("redprotect.limit.claim.") && perms.get(context).get(perm)){ limits.add(Integer.parseInt(perm.replaceAll("[^-?0-9]+", ""))); } } } ...

But return empty subjects. I using PEX.

I feel like this is more likely a pex bug…

I found the correct way!! Instead use

p.getSubjectData().getAllPermissions()

i have used

p.getContainingCollection().get(p.getIdentifier()).getSubjectData().getAllPermissions();

Edit: Still dont working…