Uploaded image for project: 'PicketLink'
  1. PicketLink
  2. PLINK-365

Error on verify ACL Permission

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • PLINK_2.6.0.CR3
    • PLINK_2.6.0.Beta3
    • IDM
    • 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()

      { voter = new PersistentPermissionVoter(partitionManager); }

      @Produces
      public PermissionVoter createPermissionVoter()

      { return voter; }

      }

      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");

              psilva@redhat.com Pedro Igor Craveiro
              mronconi Marco Ronconi (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: