use of cz.metacentrum.perun.audit.events.AttributesManagerEvents.AttributeRemovedForFacilityAndUser in project perun by CESNET.
the class AttributesManagerBlImpl method removeAttributeWithoutCheck.
@Override
public boolean removeAttributeWithoutCheck(PerunSession sess, Facility facility, User user, AttributeDefinition attribute) throws WrongAttributeAssignmentException {
getAttributesManagerImpl().checkNamespace(sess, attribute, NS_USER_FACILITY_ATTR);
if (getAttributesManagerImpl().isCoreAttribute(sess, attribute))
throw new WrongAttributeAssignmentException(attribute);
boolean changed;
if (getAttributesManagerImpl().isVirtAttribute(sess, attribute)) {
changed = getAttributesManagerImpl().removeVirtualAttribute(sess, facility, user, attribute);
} else {
changed = getAttributesManagerImpl().removeAttribute(sess, facility, user, attribute);
}
if (changed) {
getAttributesManagerImpl().changedAttributeHook(sess, facility, user, new Attribute(attribute));
log.info("{} removed attribute {} from user {} on facility {}.", sess.getLogId(), attribute.getName(), user.getId(), facility.getId());
getPerunBl().getAuditer().log(sess, new AttributeRemovedForFacilityAndUser(new AttributeDefinition(attribute), facility, user));
}
return changed;
}
Aggregations