cancel
Showing results for 
Search instead for 
Did you mean: 

List all roles

k4sourabh
Champ in-the-making
Champ in-the-making
Hi,
I want to know how can i list all the custom role defined in PermissionDefinition.xml file using a Web-service api.
2 REPLIES 2

k4sourabh
Champ in-the-making
Champ in-the-making
Hi,
I want to know how can i list all the custom role defined in PermissionDefinition.xml file using a Web-service api.
:lol:

k4sourabh
Champ in-the-making
Champ in-the-making
The following method will list all role associated to the user at the provided reference space stored, path.


private static List<String> getACL(
         AccessControlServiceSoapBindingStub accessService,
         Reference reference, Predicate pred) throws AccessControlFault,
         RemoteException {

      System.out.println("Getting ACL for " + reference.getUuid());

      List<String> acls = new ArrayList<String>();

      Predicate predicate = new Predicate();
      predicate.setNodes(new Reference[] { reference });
      System.out.println("doneeee1");
      

      ACL[] aclArray = accessService.getACLs(pred, new ACE("",
            Constants.CONTRIBUTOR, AccessStatus
                  .fromValue(AccessStatus._acepted)));
      System.out.println("doneeee2");

      for (ACL acl : aclArray) {
         ACE[] aces = acl.getAces();
         if (aces != null) {
            for (ACE ace : aces) {
               // System.out.println("Permissions -> " + ace.getAuthority()
               // + " : " + ace.getPermission());

               if (ace.getAuthority().equalsIgnoreCase("userName")) {
                  System.out.println("userName permission –>>> "
                        + ace.getAuthority() + " ::: "
                        + ace.getPermission());
               }

            }
         }
      }

      return acls;
}

   }