1 Reply Latest reply on Sep 2, 2008 12:08 PM by zergspirit

    Trouble using PermissionManager

    zergspirit

      Hi,


      I'm currently trying to use PermissionManager to handle my permissions, and I found something I'd like to have some enlightement on.
      When granting a Permission, am I obliged to manually create instance of a seam Role ?
      I'm currently doing something like:


      PermissionManager.instance().getPermissionStore().grantPermission(new org.jboss.seam.security.permission.Permission(permissionName,permissionAction,new org.jboss.seam.security.Role(instance.getName()))); 



      That's the only way I found to be able to get through this code of JpaPermissionStore, since my Role isn't an instance of org.jboss.seam.security.Role and that this class doesn't seem to be extendable:


       protected boolean updatePermissionActions(Object target, Principal recipient, String[] actions,
               boolean set)
         {
            boolean recipientIsRole = recipient instanceof Role;
            try
            {
               if (recipientIsRole)
      


        • 1. Re: Trouble using PermissionManager
          zergspirit

          Upps, sorry, the correct code I use for granting permission is:


          PermissionManager.instance().grantPermission(new org.jboss.seam.security.permission.Permission(permissionName,permissionAction,new org.jboss.seam.security.Role(instance.getName())));