Search in sources :

Example 1 with AttributeRemovedForUes

use of cz.metacentrum.perun.audit.events.AttributesManagerEvents.AttributeRemovedForUes in project perun by CESNET.

the class AttributesManagerBlImpl method removeAttributeWithoutCheck.

private boolean removeAttributeWithoutCheck(PerunSession sess, UserExtSource ues, AttributeDefinition attribute) throws WrongAttributeAssignmentException {
    getAttributesManagerImpl().checkNamespace(sess, attribute, AttributesManager.NS_UES_ATTR);
    if (getAttributesManagerImpl().isCoreAttribute(sess, attribute))
        throw new WrongAttributeAssignmentException(attribute);
    boolean changed = getAttributesManagerImpl().removeAttribute(sess, ues, attribute);
    if (changed) {
        getAttributesManagerImpl().changedAttributeHook(sess, ues, new Attribute(attribute));
        log.info("{} removed attribute {} from user external source {}.", sess.getLogId(), attribute.getName(), ues.getId());
        getPerunBl().getAuditer().log(sess, new AttributeRemovedForUes(new AttributeDefinition(attribute), ues));
    }
    return changed;
}
Also used : Attribute(cz.metacentrum.perun.core.api.Attribute) RichAttribute(cz.metacentrum.perun.core.api.RichAttribute) WrongAttributeAssignmentException(cz.metacentrum.perun.core.api.exceptions.WrongAttributeAssignmentException) AttributeRemovedForUes(cz.metacentrum.perun.audit.events.AttributesManagerEvents.AttributeRemovedForUes) AttributeDefinition(cz.metacentrum.perun.core.api.AttributeDefinition)

Aggregations

AttributeRemovedForUes (cz.metacentrum.perun.audit.events.AttributesManagerEvents.AttributeRemovedForUes)1 Attribute (cz.metacentrum.perun.core.api.Attribute)1 AttributeDefinition (cz.metacentrum.perun.core.api.AttributeDefinition)1 RichAttribute (cz.metacentrum.perun.core.api.RichAttribute)1 WrongAttributeAssignmentException (cz.metacentrum.perun.core.api.exceptions.WrongAttributeAssignmentException)1