I'm working in a Grails application that uses a remote Rice 2.3.6 (embedded in Kuali Coeus 5.2.1) as an IAM backend. Many aspects of this are successful! But this one is not:
org.kuali.rice.kim.api.role.RoleService kimRoleServiceClient
...
kimRoleServiceClient.assignPrincipalToRole(
principalId,
role.namespace,
role.name,
qualifiers)
kimRoleServiceClient.principalHasRole(
principalId,
[kimRoleServiceClient.getRoleIdByNamespaceCodeAndName(
role.namespace,
role.name)],
qualifiers) // returns true, as expected
kimRoleServiceClient.removePrincipalFromRole(
principalId,
role.namespace,
role.name,
qualifiers)
kimRoleServiceClient.principalHasRole(
principalId,
[kimRoleServiceClient.getRoleIdByNamespaceCodeAndName(
role.namespace,
role.name)],
qualifiers) // returns true (unexpected behavior)
No error is returned, either as a result of the call or as an exception logged in the remote KC catalina.out
. I can verify in the KC UI that the role is still assigned, and it's not a caching issue between the two calls -- I can wait a respectable amount of time and the role is still assigned.
Any clues?
EDIT:
It was suggested on the rice.collab mailing list that the problem may be related to KULRICE-9835: removePrincipalFromRole uses attribute id instead of attribute name in qualifier, which is marked as fixed in Rice 2.5.1. This might present a further hurdle, but at the moment this call fails even for roles with no qualifier, i.e. when qualifiers
in the call above is an empty Map.