use of edu.internet2.middleware.grouperClient.ws.beans.WsAssignAttributesResults in project uhgroupings by uhawaii-system-its-ti-iam.
the class GroupAttributeServiceImpl method assignGroupAttributes.
// adds, removes, updates (operationName) the attribute for the group
public GroupingsServiceResult assignGroupAttributes(String attributeName, String attributeOperation, String groupPath) {
logger.info("assignGroupAttributes; " + "; attributeName: " + attributeName + "; attributeOperation: " + attributeOperation + "; group: " + groupPath + ";");
WsAssignAttributesResults attributesResults = grouperFS.makeWsAssignAttributesResultsForGroup(ASSIGN_TYPE_GROUP, attributeOperation, attributeName, groupPath);
return hs.makeGroupingsServiceResult(attributesResults, "assign " + attributeName + " attribute to " + groupPath);
}
use of edu.internet2.middleware.grouperClient.ws.beans.WsAssignAttributesResults in project uhgroupings by uhawaii-system-its-ti-iam.
the class GrouperFactoryServiceImplLocal method makeWsAssignAttributesResultsForGroup.
@Override
public WsAssignAttributesResults makeWsAssignAttributesResultsForGroup(WsSubjectLookup lookup, String attributeAssignType, String attributeAssignOperation, String attributeDefNameName, String ownerGroupName) {
WsAssignAttributesResults wsAssignAttributesResults;
Grouping grouping = groupingRepository.findByPath(ownerGroupName);
Person person = personRepository.findByUsername(lookup.getSubjectIdentifier());
if (grouping.getOwners().isMember(person)) {
wsAssignAttributesResults = makeWsAssignAttributesResultsForGroup(attributeAssignType, attributeAssignOperation, attributeDefNameName, ownerGroupName);
} else {
wsAssignAttributesResults = new WsAssignAttributesResults();
WsResultMeta wsResultMeta = new WsResultMeta();
wsResultMeta.setResultCode(FAILURE);
wsAssignAttributesResults.setResultMetadata(wsResultMeta);
}
return wsAssignAttributesResults;
}
use of edu.internet2.middleware.grouperClient.ws.beans.WsAssignAttributesResults in project uhgroupings by uhawaii-system-its-ti-iam.
the class GrouperFactoryServiceImplLocal method makeWsAssignAttributesResults.
@Override
public WsAssignAttributesResults makeWsAssignAttributesResults(String attributeAssignType, String attributeAssignOperation, String ownerGroupName, String attributeDefNameName, String attributeAssignValueOperation, WsAttributeAssignValue value) {
WsAssignAttributesResults wsAssignAttributesResults = new WsAssignAttributesResults();
WsResultMeta wsResultMeta = new WsResultMeta();
wsResultMeta.setResultCode(SUCCESS);
wsAssignAttributesResults.setResultMetadata(wsResultMeta);
Grouping grouping = groupingRepository.findByPath(ownerGroupName);
Boolean onOrrOff = null;
if (attributeAssignOperation.equals(OPERATION_ASSIGN_ATTRIBUTE)) {
onOrrOff = true;
} else if (attributeAssignOperation.equals(OPERATION_REMOVE_ATTRIBUTE)) {
onOrrOff = false;
}
if (onOrrOff != null) {
if (attributeDefNameName.equals(LISTSERV)) {
grouping.setListservOn(onOrrOff);
} else if (attributeDefNameName.equals(OPT_IN)) {
grouping.setOptInOn(onOrrOff);
} else if (attributeDefNameName.equals(OPT_OUT)) {
grouping.setOptOutOn(onOrrOff);
}
}
return wsAssignAttributesResults;
}
Aggregations