User Story
As a portal user,
I want to filter search results by my FGA role (e.g. filter.fga_role=owner)
so that I only see resources belonging to accounts I own, without having to manually identify which accounts those are.
Context
Currently there is no way to say "only show me resources I own" in a single request. Users who are owners of a subset of accounts see every resource in OpenSearch, with post-hoc FGA filtering silently trimming results. This limits queries for the users role dependencies.
Solution Path
Add filter.fga_role=<relation> as a new recognized query parameter distinct from the generic filter.<field> family. When present, it is resolved at query time and before the OpenSearch request is issued. We can do this by fetching the set of FGA objects for which the user holds the requested relation, then injecting those as an OpenSearch terms filter on filterable_fields.account_fga_object (or a similar field mapping).
Example:
GET /rest/v1/search?q=my-app&filter.fga_role=owner
Returns only resources belonging to accounts where the authenticated user has the owner relation in OpenFGA.
Out of Scope
- Changing the post-query FGA
BatchCheck behavior.
- Exposing
filter.fga_role on the /resources endpoint.
- Multi-value
filter.fga_role (single relation only for this ticket).
Open Question
Should filter.fga_role be validated against a known set of relations (e.g. owner, viewer, editor) or left open to any string?
Acceptance Criteria
Parent Epic
No response
Additional Context
No response
User Story
As a portal user,
I want to filter search results by my FGA role (e.g. filter.fga_role=owner)
so that I only see resources belonging to accounts I own, without having to manually identify which accounts those are.
Context
Currently there is no way to say "only show me resources I own" in a single request. Users who are owners of a subset of accounts see every resource in OpenSearch, with post-hoc FGA filtering silently trimming results. This limits queries for the users role dependencies.
Solution Path
Add
filter.fga_role=<relation>as a new recognized query parameter distinct from the genericfilter.<field>family. When present, it is resolved at query time and before the OpenSearch request is issued. We can do this by fetching the set of FGA objects for which the user holds the requested relation, then injecting those as an OpenSearchtermsfilter onfilterable_fields.account_fga_object(or a similar field mapping).Example:
Returns only resources belonging to accounts where the authenticated user has the
ownerrelation in OpenFGA.Out of Scope
BatchCheckbehavior.filter.fga_roleon the/resourcesendpoint.filter.fga_role(single relation only for this ticket).Open Question
Should
filter.fga_rolebe validated against a known set of relations (e.g.owner,viewer,editor) or left open to any string?Acceptance Criteria
GET /rest/v1/search?filter.fga_role=ownerreturns only resources where the authenticated user holds theownerrelation in OpenFGA for the associated account.GET /rest/v1/search?filter.fga_role=viewerlikewise scopes to viewer-accessible resources.filter.fga_rolewith otherfilter.*params works correctly (AND semantics).filter.fga_rolewith an unrecognized/invalid relation value returns HTTP 400.BatchCheckstill runs as a safety net —filter.fga_roleis an optimization, not a security bypass.filter.fga_roleis absent.Parent Epic
No response
Additional Context
No response