use of cz.metacentrum.perun.audit.events.MembersManagerEvents.SponsoredMemberUnset in project perun by CESNET.
the class MembersManagerBlImpl method unsetSponsorshipForMember.
@Override
public Member unsetSponsorshipForMember(PerunSession session, Member sponsoredMember) throws MemberNotSponsoredException {
if (!sponsoredMember.isSponsored()) {
throw new MemberNotSponsoredException(sponsoredMember + " is not sponsored member!");
}
// set member to be sponsored
List<User> sponsors = getPerunBl().getUsersManagerBl().getSponsors(session, sponsoredMember);
sponsoredMember = getMembersManagerImpl().unsetSponsorshipForMember(session, sponsoredMember);
getPerunBl().getAuditer().log(session, new SponsoredMemberUnset(sponsoredMember));
for (User sponsor : sponsors) {
getPerunBl().getAuditer().log(session, new SponsorshipRemoved(sponsoredMember, sponsor));
}
return sponsoredMember;
}
Aggregations