-
Bug
-
Resolution: Done
-
Major
-
PLINK_2.6.0.Beta3
-
Interactive Demo/Tutorial
Following the example "jboss-picketlink-quickstarts/picketlink-authorization-acl," I have problems in the verification of 'ACL using Identity.hasPermission (...). While debugging I noticed that no PermissionVoter is injected in the context of CDI. Looking at the source I found no @ Producer to utilize the following voter PersistentPermissionVoter.
I created a simple @ Producer:
@ApplicationScoped
public class PermissionVoterProducer {
private PermissionVoter voter;
@Inject
private PartitionManager partitionManager;
@Inject
public void init()
@Produces
public PermissionVoter createPermissionVoter()
}
But when I try to check a permission I get the following exception:
Caused by: java.lang.NullPointerException
at org.picketlink.idm.jpa.internal.JPAIdentityStore.lookupPermissionEntity(JPAIdentityStore.java:1594)
at org.picketlink.idm.jpa.internal.JPAIdentityStore.grantPermission(JPAIdentityStore.java:1634)
at org.picketlink.idm.internal.ContextualPermissionManager.grantPermission(ContextualPermissionManager.java:55)
... 66 more
Checking the permissions on the database has been correctly entered with the following code:
User user = (User) identity.getAccount();
permissionManager.grantPermission(user, association, "UPDATE");