use of cz.metacentrum.perun.audit.events.AttributesManagerEvents.AllAttributesRemovedForMemberAndGroup in project perun by CESNET.
the class AttributesManagerBlImpl method removeAllAttributes.
@Override
public void removeAllAttributes(PerunSession sess, Member member, Group group) throws WrongAttributeValueException, WrongReferenceAttributeValueException, MemberGroupMismatchException {
List<Attribute> attributes = getAttributes(sess, member, group);
if (getAttributesManagerImpl().removeAllAttributes(sess, member, group)) {
getPerunBl().getAuditer().log(sess, new AllAttributesRemovedForMemberAndGroup(member, group));
}
log.info("{} removed all attributes from member {} in group {}.", sess.getLogId(), member.getId(), group.getId());
for (Attribute attribute : attributes) attribute.setValue(null);
try {
checkAttributesSemantics(sess, member, group, attributes);
checkAttributesDependencies(sess, member, group, attributes);
} catch (WrongAttributeAssignmentException ex) {
throw new ConsistencyErrorException(ex);
}
for (Attribute attribute : attributes) {
getAttributesManagerImpl().changedAttributeHook(sess, member, group, new Attribute(attribute));
}
}
Aggregations