use of edu.internet2.middleware.grouperClient.ws.beans.WsGetMembershipsResults in project uhgroupings by uhawaii-system-its-ti-iam.
the class MembershipServiceImpl method removeSelfOpted.
// removes the self-opted attribute from the membership that corresponds to the user and group
@Override
public GroupingsServiceResult removeSelfOpted(String groupPath, String username) {
logger.info("removeSelfOpted; group: " + groupPath + "; username: " + username + ";");
String action = "remove self-opted attribute from the membership of " + username + " to " + groupPath;
if (mas.isMember(groupPath, username)) {
if (mas.isSelfOpted(groupPath, username)) {
WsGetMembershipsResults membershipsResults = hs.membershipsResults(username, groupPath);
String membershipID = hs.extractFirstMembershipID(membershipsResults);
return hs.makeGroupingsServiceResult(assignMembershipAttributes(OPERATION_REMOVE_ATTRIBUTE, SELF_OPTED, membershipID), action);
}
return hs.makeGroupingsServiceResult(SUCCESS + ", " + username + " was not self-opted into " + groupPath, action);
}
return hs.makeGroupingsServiceResult(FAILURE + ", " + username + " is not a member of " + groupPath, action);
}
use of edu.internet2.middleware.grouperClient.ws.beans.WsGetMembershipsResults in project uhgroupings by uhawaii-system-its-ti-iam.
the class MembershipServiceImpl method addSelfOpted.
// adds the self-opted attribute to the membership between the group and user
@Override
public GroupingsServiceResult addSelfOpted(String groupPath, String username) {
logger.info("addSelfOpted; group: " + groupPath + "; username: " + username + ";");
String action = "add self-opted attribute to the membership of " + username + " to " + groupPath;
if (mas.isMember(groupPath, username)) {
if (!mas.isSelfOpted(groupPath, username)) {
WsGetMembershipsResults includeMembershipsResults = hs.membershipsResults(username, groupPath);
String membershipID = hs.extractFirstMembershipID(includeMembershipsResults);
return hs.makeGroupingsServiceResult(assignMembershipAttributes(OPERATION_ASSIGN_ATTRIBUTE, SELF_OPTED, membershipID), action);
}
return hs.makeGroupingsServiceResult(SUCCESS + ", " + username + " was already self opted into " + groupPath, action);
}
return hs.makeGroupingsServiceResult(FAILURE + ", " + username + " is not a member of " + groupPath, action);
}
Aggregations