Source:
<code>public List<Attribute> getAttributes(PerunSession sess, Resource resource, Group group, List<String> attrNames, boolean workWithGroupAttributes) throws PrivilegeException, InternalErrorException, ResourceNotExistsException, GroupNotExistsException, GroupResourceMismatchException, WrongAttributeAssignmentException { Utils.checkPerunSession(sess); getPerunBl().getResourcesManagerBl().checkResourceExists(sess, resource); getPerunBl().getGroupsManagerBl().checkGroupExists(sess, group); <START> if(!getPerunBl().getGroupsManagerBl().getVo(sess, group).equals(getPerunBl().getResourcesManagerBl().getVo(sess, resource))) { <END> throw new GroupResourceMismatchException("group and resource are not in the same VO"); } List<Attribute> attributes = getAttributesManagerBl().getAttributes(sess, resource, group, attrNames, workWithGroupAttributes); Iterator<Attribute> attrIter = attributes.iterator(); while(attrIter.hasNext()) { Attribute attrNext = attrIter.next(); if(getAttributesManagerBl().isFromNamespace(sess, attrNext, NS_GROUP_ATTR)) { if(!AuthzResolver.isAuthorizedForAttribute(sess, ActionType.READ, attrNext, group, null)) attrIter.remove(); else attrNext.setWritable(AuthzResolver.isAuthorizedForAttribute(sess, ActionType.WRITE, attrNext, group, null)); } else if(getAttributesManagerBl().isFromNamespace(sess, attrNext, NS_GROUP_RESOURCE_ATTR)) { if(!AuthzResolver.isAuthorizedForAttribute(sess, ActionType.READ, attrNext, group, resource)) attrIter.remove(); else attrNext.setWritable(AuthzResolver.isAuthorizedForAttribute(sess, ActionType.WRITE, attrNext, group, resource)); } else { throw new ConsistencyErrorException("One of getting attribute is not type of group or group_resource : " + attrNext); } } return attributes; }</code><technical_language>is check in Bl private method Bl. if want check, objects belong VO, simply compare voId stored in of them, private method checkGroupIsFromTheSameVoLikeResource() in Bl does. is need load objects DB</technical_language>

Target:
public List<Attribute> getAttributes(PerunSession sess, Resource resource, Group group, List<String> attrNames, boolean workWithGroupAttributes) throws PrivilegeException, InternalErrorException, ResourceNotExistsException, GroupNotExistsException, GroupResourceMismatchException, WrongAttributeAssignmentException { Utils.checkPerunSession(sess); getPerunBl().getResourcesManagerBl().checkResourceExists(sess, resource); getPerunBl().getGroupsManagerBl().checkGroupExists(sess, group); List<Attribute> attributes = getAttributesManagerBl().getAttributes(sess, resource, group, attrNames, workWithGroupAttributes); Iterator<Attribute> attrIter = attributes.iterator(); while(attrIter.hasNext()) { Attribute attrNext = attrIter.next(); if(getAttributesManagerBl().isFromNamespace(sess, attrNext, NS_GROUP_ATTR)) { if(!AuthzResolver.isAuthorizedForAttribute(sess, ActionType.READ, attrNext, group, null)) attrIter.remove(); else attrNext.setWritable(AuthzResolver.isAuthorizedForAttribute(sess, ActionType.WRITE, attrNext, group, null)); } else if(getAttributesManagerBl().isFromNamespace(sess, attrNext, NS_GROUP_RESOURCE_ATTR)) { if(!AuthzResolver.isAuthorizedForAttribute(sess, ActionType.READ, attrNext, group, resource)) attrIter.remove(); else attrNext.setWritable(AuthzResolver.isAuthorizedForAttribute(sess, ActionType.WRITE, attrNext, group, resource)); } else { throw new ConsistencyErrorException("One of getting attribute is not type of group or group_resource : " + attrNext); } } return attributes; }