use of cz.metacentrum.perun.audit.events.AttributesManagerEvents.AttributeRemovedForUser in project perun by CESNET.
the class AttributesManagerBlImpl method removeAttributeWithoutCheck.
@Override
public boolean removeAttributeWithoutCheck(PerunSession sess, User user, AttributeDefinition attribute) throws WrongAttributeAssignmentException {
getAttributesManagerImpl().checkNamespace(sess, attribute, NS_USER_ATTR);
if (getAttributesManagerImpl().isCoreAttribute(sess, attribute))
throw new WrongAttributeAssignmentException(attribute);
boolean changed = getAttributesManagerImpl().removeAttribute(sess, user, attribute);
if (changed) {
try {
getAttributesManagerImpl().changedAttributeHook(sess, user, new Attribute(attribute));
} catch (WrongReferenceAttributeValueException ex) {
throw new InternalErrorException(ex);
}
log.info("{} removed attribute {} from user {}.", sess.getLogId(), attribute.getName(), user.getId());
getPerunBl().getAuditer().log(sess, new AttributeRemovedForUser(new AttributeDefinition(attribute), user));
}
return changed;
}
use of cz.metacentrum.perun.audit.events.AttributesManagerEvents.AttributeRemovedForUser in project perun by CESNET.
the class urn_perun_user_attribute_def_virt_tcsMails_muTest method resolveVirtualAttributeValueChangeRemoved3.
@Test
public void resolveVirtualAttributeValueChangeRemoved3() throws Exception {
AuditEvent userRem = new AttributeRemovedForUser(publicMailsAttr, user);
List<AuditEvent> msgs = classInstance.resolveVirtualAttributeValueChange(sess, userRem);
assertTrue("audit should contain change of tcsMails", msgs.get(0).getMessage().contains(expectedTestOfMessage));
}
use of cz.metacentrum.perun.audit.events.AttributesManagerEvents.AttributeRemovedForUser in project perun by CESNET.
the class urn_perun_user_attribute_def_virt_tcsMails_muTest method resolveVirtualAttributeValueChangeRemoved4.
@Test
public void resolveVirtualAttributeValueChangeRemoved4() throws Exception {
AuditEvent userRem = new AttributeRemovedForUser(privateMailsAttr, user);
List<AuditEvent> msgs = classInstance.resolveVirtualAttributeValueChange(sess, userRem);
assertTrue("audit should contain change of tcsMails", msgs.get(0).getMessage().contains(expectedTestOfMessage));
}
Aggregations