use of cz.metacentrum.perun.core.api.RichAttribute in project perun by CESNET.
the class AttributesManagerBlImpl method removeAttribute.
public void removeAttribute(PerunSession sess, Member member, AttributeDefinition attribute) throws InternalErrorException, WrongAttributeAssignmentException, WrongAttributeValueException, WrongReferenceAttributeValueException {
if (removeAttributeWithoutCheck(sess, member, attribute)) {
checkAttributeValue(sess, member, new Attribute(attribute));
this.checkAttributeDependencies(sess, new RichAttribute(member, null, new Attribute(attribute)));
}
}
use of cz.metacentrum.perun.core.api.RichAttribute in project perun by CESNET.
the class AttributesManagerBlImpl method setAttribute.
public void setAttribute(PerunSession sess, Resource resource, Member member, Attribute attribute, boolean workWithUserAttributes) throws InternalErrorException, WrongAttributeValueException, WrongAttributeAssignmentException, WrongReferenceAttributeValueException {
if (attribute.getValue() == null) {
removeAttribute(sess, resource, member, attribute);
return;
}
if (!workWithUserAttributes) {
if (setAttributeWithoutCheck(sess, resource, member, attribute, false)) {
this.checkAttributeDependencies(sess, new RichAttribute(resource, member, attribute));
checkAttributeValue(sess, resource, member, attribute);
}
} else {
if (setAttributeWithoutCheck(sess, resource, member, attribute, true)) {
List<Attribute> listOfAttributes = new ArrayList<Attribute>();
listOfAttributes.add(attribute);
checkAttributesValue(sess, resource, member, listOfAttributes, workWithUserAttributes);
this.checkAttributesDependencies(sess, resource, member, listOfAttributes, workWithUserAttributes);
}
}
}
Aggregations