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>
(cherry picked from commit 3c57e325f77f2b6b8fd39439513b13ef5ea248f2)
This commit is contained in:
Iraq 2025-03-05 21:48:20 +00:00 committed by Livio Spring
parent 52bb9ca3a5
commit 1c121ec230
No known key found for this signature in database

View File

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