Source:
<code><START> public void removeAttributes(PerunSession sess, Facility facility, Resource resource, Group group, User user, Member member, List<? extends AttributeDefinition> attributes) throws InternalErrorException, WrongAttributeValueException, WrongAttributeAssignmentException, WrongReferenceAttributeValueException{ <END> this.checkMemberIsFromTheSameVoLikeResource(sess, member, resource); this.checkGroupIsFromTheSameVoLikeResource(sess, group, resource); List<AttributeDefinition> attributesToCheck = new ArrayList<AttributeDefinition>(); for(AttributeDefinition attribute : attributes) { if(!getAttributesManagerImpl().isCoreAttribute(sess, attribute)) { if(getAttributesManagerImpl().isFromNamespace(sess, attribute, AttributesManager.NS_MEMBER_ATTR)) { if (removeAttributeWithoutCheck(sess, member, attribute)) attributesToCheck.add(attribute); } else if(getAttributesManagerImpl().isFromNamespace(sess, attribute, AttributesManager.NS_USER_ATTR)) { if (removeAttributeWithoutCheck(sess, user, attribute)) attributesToCheck.add(attribute); } else if(getAttributesManagerImpl().isFromNamespace(sess, attribute, AttributesManager.NS_MEMBER_RESOURCE_ATTR)){ if (removeAttributeWithoutCheck(sess, resource, member, attribute)) attributesToCheck.add(attribute); } else if(getAttributesManagerImpl().isFromNamespace(sess, attribute, AttributesManager.NS_USER_FACILITY_ATTR)){ if (removeAttributeWithoutCheck(sess, facility, user, attribute)) attributesToCheck.add(attribute); } else if(getAttributesManagerImpl().isFromNamespace(sess, attribute, AttributesManager.NS_MEMBER_GROUP_ATTR)){ if (removeAttributeWithoutCheck(sess, member, group, attribute)) attributesToCheck.add(attribute); } else { throw new WrongAttributeAssignmentException(attribute); } } } this.checkAttributesValue(sess, facility, resource, group, user, member, attributesFromDefinitions(attributesToCheck)); this.checkAttributesDependencies(sess, resource, group, member, user, facility, attributesFromDefinitions(attributesToCheck)); }</code><technical_language>in other methods. group-resource attributes? is problem check too</technical_language>

Target:
public void removeAttributes(PerunSession sess, Facility facility, Resource resource, Group group, User user, Member member, List<? extends AttributeDefinition> attributes) throws InternalErrorException, WrongAttributeValueException, WrongAttributeAssignmentException, WrongReferenceAttributeValueException, GroupResourceMismatchException, MemberResourceMismatchException { this.checkMemberIsFromTheSameVoLikeResource(sess, member, resource); this.checkGroupIsFromTheSameVoLikeResource(sess, group, resource); List<AttributeDefinition> attributesToCheck = new ArrayList<AttributeDefinition>(); for(AttributeDefinition attribute : attributes) { if(!getAttributesManagerImpl().isCoreAttribute(sess, attribute)) { if(getAttributesManagerImpl().isFromNamespace(sess, attribute, AttributesManager.NS_MEMBER_ATTR)) { if (removeAttributeWithoutCheck(sess, member, attribute)) attributesToCheck.add(attribute); } else if(getAttributesManagerImpl().isFromNamespace(sess, attribute, AttributesManager.NS_USER_ATTR)) { if (removeAttributeWithoutCheck(sess, user, attribute)) attributesToCheck.add(attribute); } else if(getAttributesManagerImpl().isFromNamespace(sess, attribute, AttributesManager.NS_MEMBER_RESOURCE_ATTR)){ if (removeAttributeWithoutCheck(sess, resource, member, attribute)) attributesToCheck.add(attribute); } else if(getAttributesManagerImpl().isFromNamespace(sess, attribute, AttributesManager.NS_USER_FACILITY_ATTR)){ if (removeAttributeWithoutCheck(sess, facility, user, attribute)) attributesToCheck.add(attribute); } else if(getAttributesManagerImpl().isFromNamespace(sess, attribute, AttributesManager.NS_MEMBER_GROUP_ATTR)){ if (removeAttributeWithoutCheck(sess, member, group, attribute)) attributesToCheck.add(attribute); } else { throw new WrongAttributeAssignmentException(attribute); } } } this.checkAttributesValue(sess, facility, resource, group, user, member, attributesFromDefinitions(attributesToCheck)); this.checkAttributesDependencies(sess, resource, group, member, user, facility, attributesFromDefinitions(attributesToCheck)); }