Search in sources :

Example 1 with AttributeRemovedForMemberAndGroup

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

the class AttributesManagerBlImpl method removeAttributeWithoutCheck.

// s workWithUserAttr.
@Override
public boolean removeAttributeWithoutCheck(PerunSession sess, Member member, Group group, AttributeDefinition attribute) throws WrongAttributeAssignmentException, MemberGroupMismatchException {
    this.checkMemberIsFromTheSameVoLikeGroup(sess, member, group);
    getAttributesManagerImpl().checkNamespace(sess, attribute, NS_MEMBER_GROUP_ATTR);
    if (getAttributesManagerImpl().isCoreAttribute(sess, attribute))
        throw new WrongAttributeAssignmentException(attribute);
    boolean changed = getAttributesManagerImpl().removeAttribute(sess, member, group, attribute);
    if (changed) {
        getAttributesManagerImpl().changedAttributeHook(sess, member, group, new Attribute(attribute));
        log.info("{} removed attribute {} from member {} in group {}.", sess.getLogId(), attribute.getName(), member.getId(), group.getId());
        getPerunBl().getAuditer().log(sess, new AttributeRemovedForMemberAndGroup(new AttributeDefinition(attribute), member, group));
    }
    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) AttributeRemovedForMemberAndGroup(cz.metacentrum.perun.audit.events.AttributesManagerEvents.AttributeRemovedForMemberAndGroup) AttributeDefinition(cz.metacentrum.perun.core.api.AttributeDefinition)

Aggregations

AttributeRemovedForMemberAndGroup (cz.metacentrum.perun.audit.events.AttributesManagerEvents.AttributeRemovedForMemberAndGroup)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