Search in sources :

Example 1 with AttributeSetForVo

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

the class AttributesManagerBlImpl method setAttributeWithoutCheck.

@Override
public boolean setAttributeWithoutCheck(PerunSession sess, Vo vo, Attribute attribute) throws WrongAttributeAssignmentException, WrongAttributeValueException {
    getAttributesManagerImpl().checkNamespace(sess, attribute, AttributesManager.NS_VO_ATTR);
    if (getAttributesManagerImpl().isCoreAttribute(sess, attribute))
        throw new WrongAttributeAssignmentException(attribute);
    boolean changed;
    if (isVirtAttribute(sess, attribute)) {
        throw new InternalErrorException("Virtual attribute can't be set this way yet. Please set physical attribute.");
    } else {
        changed = getAttributesManagerImpl().setAttribute(sess, vo, attribute);
    }
    if (changed) {
        getPerunBl().getAuditer().log(sess, new AttributeSetForVo(attribute, vo));
        getAttributesManagerImpl().changedAttributeHook(sess, vo, attribute);
    }
    return changed;
}
Also used : AttributeSetForVo(cz.metacentrum.perun.audit.events.AttributesManagerEvents.AttributeSetForVo) WrongAttributeAssignmentException(cz.metacentrum.perun.core.api.exceptions.WrongAttributeAssignmentException) InternalErrorException(cz.metacentrum.perun.core.api.exceptions.InternalErrorException)

Aggregations

AttributeSetForVo (cz.metacentrum.perun.audit.events.AttributesManagerEvents.AttributeSetForVo)1 InternalErrorException (cz.metacentrum.perun.core.api.exceptions.InternalErrorException)1 WrongAttributeAssignmentException (cz.metacentrum.perun.core.api.exceptions.WrongAttributeAssignmentException)1