use of edu.internet2.middleware.grouperClient.api.GcHasMember in project uPortal by Jasig.
the class GrouperEntityGroupStore method contains.
/* (non-Javadoc)
* @see org.apereo.portal.groups.IEntityGroupStore#contains(org.apereo.portal.groups.IEntityGroup, org.apereo.portal.groups.IGroupMember)
*/
public boolean contains(IEntityGroup group, IGroupMember member) throws GroupsException {
String groupContainerName = group.getLocalKey();
String groupMemberName = member.getKey();
if (!validKey(groupContainerName) || !validKey(groupMemberName)) {
return false;
}
GcHasMember gcHasMember = new GcHasMember();
gcHasMember.assignGroupName(groupContainerName);
gcHasMember.addSubjectLookup(new WsSubjectLookup(null, "g:gsa", groupMemberName));
WsHasMemberResults wsHasMemberResults = gcHasMember.execute();
if (GrouperClientUtils.length(wsHasMemberResults.getResults()) == 1) {
WsHasMemberResult wsHasMemberResult = wsHasMemberResults.getResults()[0];
return StringUtils.equals("IS_MEMBER", wsHasMemberResult.getResultMetadata().getResultCode());
}
return false;
}
Aggregations