fix(permission): sql error in cmd/setup/49/01-permitted_orgs_function.sql (#9465)

# Which Problems Are Solved

SQL error in `cmd/setup/49/01-permitted_orgs_function.sql`

# How the Problems Are Solved

Updating `cmd/setup/49/01-permitted_orgs_function.sql`

# Additional Context

- Closes https://github.com/zitadel/zitadel/issues/9461

Co-authored-by: Iraq Jaber <IraqJaber@gmail.com>
This commit is contained in:
Iraq 2025-03-05 21:48:20 +00:00 committed by GitHub
parent a82f5805b6
commit 3c57e325f7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -43,14 +43,14 @@ BEGIN
END;
-- Return the organizations where permission were granted thru org-level roles
SELECT array_agg(org_id) INTO org_ids
SELECT array_agg(sub.org_id) INTO org_ids
FROM (
SELECT DISTINCT om.org_id
FROM eventstore.org_members om
WHERE om.role = ANY(matched_roles)
AND om.instance_id = instanceID
AND om.user_id = userId
);
) AS sub;
RETURN;
END;
$$;