Search in sources :

Example 6 with WsAssignAttributesResults

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);
}
Also used : WsAssignAttributesResults(edu.internet2.middleware.grouperClient.ws.beans.WsAssignAttributesResults)

Example 7 with WsAssignAttributesResults

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;
}
Also used : WsAssignAttributesResults(edu.internet2.middleware.grouperClient.ws.beans.WsAssignAttributesResults) Grouping(edu.hawaii.its.api.type.Grouping) WsResultMeta(edu.internet2.middleware.grouperClient.ws.beans.WsResultMeta) Person(edu.hawaii.its.api.type.Person)

Example 8 with 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;
}
Also used : WsAssignAttributesResults(edu.internet2.middleware.grouperClient.ws.beans.WsAssignAttributesResults) WsResultMeta(edu.internet2.middleware.grouperClient.ws.beans.WsResultMeta) Grouping(edu.hawaii.its.api.type.Grouping)

Aggregations

WsAssignAttributesResults (edu.internet2.middleware.grouperClient.ws.beans.WsAssignAttributesResults)8 WsResultMeta (edu.internet2.middleware.grouperClient.ws.beans.WsResultMeta)4 Grouping (edu.hawaii.its.api.type.Grouping)3 Test (org.junit.Test)2 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)2 Membership (edu.hawaii.its.api.type.Membership)1 Person (edu.hawaii.its.api.type.Person)1 WsAttributeAssignValue (edu.internet2.middleware.grouperClient.ws.beans.WsAttributeAssignValue)1 WsMembership (edu.internet2.middleware.grouperClient.ws.beans.WsMembership)1 WsSubjectLookup (edu.internet2.middleware.grouperClient.ws.beans.WsSubjectLookup)1