Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

fix: issue with project listing

IgorHortac81e9938262c
diff --git a/backend/src/ee/services/group/group-dal.ts b/backend/src/ee/services/group/group-dal.ts
index 6a235e60a1..149560c42b 100644
--- a/backend/src/ee/services/group/group-dal.ts
+++ b/backend/src/ee/services/group/group-dal.ts
@@ -472,9 +472,18 @@ export const groupDALFactory = (db: TDbClient) => {
orderDirection?: OrderByDirection;
}) => {
try {
+ // Include projects in the group's org and in any child sub-orgs (so root-org groups show inherited sub-org projects)
+ const projectOrgIdsSubquery = db
+ .replicaNode()(TableName.Organization)
+ .where(`${TableName.Organization}.rootOrgId`, orgId)
+ .select(db.ref("id").withSchema(TableName.Organization));
const query = db
.replicaNode()(TableName.Project)
- .where(`${TableName.Project}.orgId`, orgId)
+ .andWhere((qb) => {
+ void qb
+ .where(`${TableName.Project}.orgId`, orgId)
+ .orWhereIn(`${TableName.Project}.orgId`, projectOrgIdsSubquery);
+ })
.leftJoin(TableName.Membership, (bd) => {
bd.on(`${TableName.Project}.id`, "=", `${TableName.Membership}.scopeProjectId`)
.andOn(`${TableName.Membership}.actorGroupId`, "=", db.raw("?", [groupId]))
diff --git a/backend/src/ee/services/license/license-fns.ts b/backend/src/ee/services/license/license-fns.ts
index e94f89113d..cfe49567e9 100644
--- a/backend/src/ee/services/license/license-fns.ts
+++ b/backend/src/ee/services/license/license-fns.ts
@@ -71,7 +71,7 @@ export const getDefaultOnPremFeatures = (): TFeatureSet => ({
rbac: false,
githubOrgSync: false,
customRateLimits: false,
- subOrganization: false,
+ subOrganization: true,
customAlerts: false,
secretAccessInsights: false,
auditLogs: false,
@@ -84,7 +84,7 @@ export const getDefaultOnPremFeatures = (): TFeatureSet => ({
oidcSSO: false,
scim: false,
ldap: false,
- groups: false,
+ groups: true,
status: null,
trial_end: null,
has_used_trial: true,
diff --git a/backend/src/services/project/project-dal.ts b/backend/src/services/project/project-dal.ts
index 68661e776f..6916832eab 100644
--- a/backend/src/services/project/project-dal.ts
+++ b/backend/src/services/project/project-dal.ts
@@ -358,7 +358,6 @@ export const projectDALFactory = (db: TDbClient) => {
const { limit = 20, offset = 0, sortBy = SearchProjectSortBy.NAME, sortDir = SortDirection.ASC } = dto;
const groupMembershipSubquery = db(TableName.Groups)
.leftJoin(TableName.UserGroupMembership, `${TableName.UserGroupMembership}.groupId`, `${TableName.Groups}.id`)
- .where(`${TableName.Groups}.orgId`, dto.orgId)
.where(`${TableName.UserGroupMembership}.userId`, dto.actorId)
.select(db.ref("id").withSchema(TableName.Groups));
@@ -369,7 +368,6 @@ export const projectDALFactory = (db: TDbClient) => {
`${TableName.IdentityGroupMembership}.groupId`,
`${TableName.Groups}.id`
)
- .where(`${TableName.Groups}.orgId`, dto.orgId)
.where(`${TableName.IdentityGroupMembership}.identityId`, dto.actorId)
.select(db.ref("id").withSchema(TableName.Groups));