use of cz.metacentrum.perun.audit.events.AttributesManagerEvents.AttributeRemovedForGroupAndResource in project perun by CESNET.
the class AttributesManagerBlImpl method removeAttributeWithoutCheck.
@Override
public boolean removeAttributeWithoutCheck(PerunSession sess, Resource resource, Group group, AttributeDefinition attribute) throws WrongAttributeAssignmentException, GroupResourceMismatchException {
this.checkGroupIsFromTheSameVoLikeResource(sess, group, resource);
getAttributesManagerImpl().checkNamespace(sess, attribute, AttributesManager.NS_GROUP_RESOURCE_ATTR);
boolean changed;
if (this.isVirtAttribute(sess, attribute)) {
changed = getAttributesManagerImpl().removeVirtualAttribute(sess, resource, group, attribute);
} else {
changed = getAttributesManagerImpl().removeAttribute(sess, resource, group, attribute);
}
if (changed)
getAttributesManagerImpl().changedAttributeHook(sess, resource, group, new Attribute(attribute));
if (changed)
log.info("{} removed attribute {} from group {} on resource {}.", sess.getLogId(), attribute.getName(), group.getId(), resource.getId());
getPerunBl().getAuditer().log(sess, new AttributeRemovedForGroupAndResource(new AttributeDefinition(attribute), group, resource));
return changed;
}
Aggregations