.join(group.organization, organization)
.where(organization.in(getExplicitOrganizationsForUser(user).list(organization))).list(applicationVersion)));
return cacheableQuery().from(applicationVersion)
.where(applicationVersion.application.id.eq(applicationId) /* ApplicationVersion belongs to specified Application */
.and(applicationVersion.application.in(availableApplicationsForUser.list(application))) /* ApplicationVersion belongs to an application which the user has access */
.and(getApplicationVersionAppStateExpression(downloadableAppStates.toArray(new AppState[downloadableAppStates.size()]))) /* ApplicationVersion is in a downloadable AppState */
.and(applicationVersionOwnedGroup /* ApplicationVersion belongs to a group which a users has access */
.or(applicationVersionGuestGroup) /* ApplicationVersion is shared to a Guest Group which a user belongs */
.or(applicationVersionOrgPublish)
)