3 Replies Latest reply on Jan 24, 2007 10:25 AM by 666705

    how to overcome this error and get Usregroup?

    666705
      hi,
      i am traing to get USERGROUPS for one role.
      i am getting error like
      error:
      -------------
      test onAcquire() : <anonymous>
      <Jan 20, 2006 5:05:23 PM SGT> <Error> <Entitlements> <BEA-402726> <Attempt to a
      cess Entitlement Policy Mgmt API by user in invalid role. Entitlement Policy op
      ration attempted by disallowed user ["principals=[]"].>
      <Jan 20, 2006 5:05:23 PM SGT> <Warning> <WLW> <000000> <Id=top-level; Method=go
      .ipto.ipt.acl.usergroupsbyroles.UserGroupsByRolesBM.getGroupsForRole(); Failure
      com.bea.p13n.entitlements.common.PolicyMgmtAccessException: Attempt to access E
      titlement Policy Mgmt API by user in invalid role. Entitlement Policy operation
      attempted by disallowed user ["principals=[]"]. [ServiceException]>
      com.bea.p13n.entitlements.common.PolicyMgmtAccessException: Attempt to access E
      titlement Policy Mgmt API by user in invalid role. Entitlement Policy operation
      attempted by disallowed user ["principals=[]"].
      at com.bea.p13n.entitlements.management.internal.SecurityHelper.isWLPAd
      inRole(SecurityHelper.java:555)
      ------------
      my code look like this
      ------
      public List getGroupsForRole(String roleName) throws PolicyNotFoundException, PolicyException
      {

      String enterpriseAppName = getProperty("ent_app_name");
      String portalWebAppName = getProperty("web_app_name");
      String appResourceID = getProperty("app_resource_id");


      RolePolicyItem rolePolicyItem = new RolePolicyItem(enterpriseAppName,
      portalWebAppName,
      roleName,
      EntitlementConstants.HIERARCHICAL_ROLE_INHERITANCE,
      null, null, null, null );


      rolePolicyItem = RolePolicyManager.getRolePolicy( rolePolicyItem );

      List gList =rolePolicyItem.getGroupList();



      return gList;
      }
      --------------
      i try to access the above method and passing one role
      like this
      List arrGrp = new ArrayList();
      arrGrp = userGroupByRolesBM.getGroupsForRole("AuthenticatedVisitor");
      System.out.println("arr group=="+arrGrp.size());
      if(arrGrp != null)
      {

      Object objGrp[] = arrGrp.toArray();

      for(int k = 0; k<objGrp.length; k++)
      {
      System.out.println("role exit in groups==="+objGrp[k]);
      }

      }
      -----------------
      can any one how to resolve this,
      thanks
      jpullareddy