class urn_perun_member_group_attribute_def_virt_isGroupAdmin extends MemberGroupVirtualAttributesModuleAbstract implements MemberGroupVirtualAttributesModuleImplApi {

    @Override
    public Attribute getAttributeValue(PerunSessionImpl sess, Member member, Group group, AttributeDefinition attributeDefinition) {

        List<User> userAdminList;
        User newUser;
        Attribute attribute = new Attribute(attributeDefinition);

        userAdminList = sess.getPerunBl().getGroupsManagerBl().getAdmins(sess, group, false);
        newUser = sess.getPerunBl().getUsersManagerBl().getUserByMember(sess, member);

        if (userAdminList.contains(newUser)) {
            attribute.setValue(true);
            return attribute;
        }

        attribute.setValue(false);
        return attribute;

    }

}