LiveCycle ES: ClassCastException calling deletePermsForPrincipalForRes(String, String, List)

Issue

If you are trying to remove permissions for a service in LiveCycle ES using the API method
  AuthorizationManager.deletePermsForPrincipalForRes(String principalOid, String resourceId, List permList)
you may encounter the following exception running your Java code:

| [com.adobe.idp.um.api.impl.AuthorizationManagerImpl] errorCode:16385 errorCodeHEX:0x4001 message:public method - 
| [IDPLoggedException] errorCode:8193 errorCodeHEX:0x2001 message:public method - chainedException:java.lang.ClassCastException: 
com.adobe.idp.um.api.infomodel.impl.PermissionImplchainedExceptionMessage:com.adobe.idp.um.api.infomodel.impl.PermissionImpl 
chainedException trace:java.lang.ClassCastException: com.adobe.idp.um.api.infomodel.impl.PermissionImpl
    at com.adobe.idp.um.businesslogic.directoryservices.DirectoryServicesManagerBean.modifyPermsToPrincipalForRes(DirectoryServicesManagerBean.java:7602)
    at com.adobe.idp.um.businesslogic.directoryservices.DirectoryServicesManagerBean.deletePermsForPrincipalForRes(DirectoryServicesManagerBean.java:7752)
    at com.adobe.idp.um.businesslogic.directoryservices.DirectoryServicesManagerBean_jrc290_ELOImpl.deletePermsForPrincipalForRes(DirectoryServicesManagerBean_jrc290_ELOImpl.java:2066)
    at com.adobe.idp.um.api.impl.AuthorizationManagerImpl.deletePermsForPrincipalForRes(AuthorizationManagerImpl.java:860)
    at com.adobe.idp.um.dscservice.AuthorizationManagerServiceImpl.deletePermsForPrincipalForRes(AuthorizationManagerServiceImpl.java:407)
    ....

Solution

This exception occurs if you try to pass a List of <Permission> objects to the method for the last argument. This List should display a List of <String> objects containing the permission OIDs for each permission object you want to remove.

Here is some sample code (ManageRolesAndPermissionsTest) to fix this issue.

Additional information

The current JavaDoc reference for LiveCycle ES is available at:

http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/javadoc/com/adobe/idp/um/api/AuthorizationManager.html#deletePermsForPrincipalForRes%28%29

reference: (181407999/2541386)

VN:F [1.9.22_1171]
Was this helpful? Please rate the content.
Rating: 0.0/10 (0 votes cast)