use of cz.metacentrum.perun.audit.events.AttributesManagerEvents.AttributeRemovedForResourceAndMember in project perun by CESNET.
the class AttributesManagerBlImpl method removeAttributeWithoutCheck.
@Override
public boolean removeAttributeWithoutCheck(PerunSession sess, Member member, Resource resource, AttributeDefinition attribute) throws WrongAttributeAssignmentException, WrongReferenceAttributeValueException, MemberResourceMismatchException {
this.checkMemberIsFromTheSameVoLikeResource(sess, member, resource);
getAttributesManagerImpl().checkNamespace(sess, attribute, NS_MEMBER_RESOURCE_ATTR);
if (getAttributesManagerImpl().isCoreAttribute(sess, attribute))
throw new WrongAttributeAssignmentException(attribute);
boolean changed = getAttributesManagerImpl().removeAttribute(sess, member, resource, attribute);
if (changed) {
getAttributesManagerImpl().changedAttributeHook(sess, member, resource, new Attribute(attribute));
log.info("{} removed attribute {} from member {} on resource {}.", sess.getLogId(), attribute.getName(), member.getId(), resource.getId());
getPerunBl().getAuditer().log(sess, new AttributeRemovedForResourceAndMember(new AttributeDefinition(attribute), resource, member));
}
return changed;
}
Aggregations