Skip to content

Commit 259e8aa

Browse files
authored
Add acl filtering question to FAQ (#410)
1 parent 3a250dd commit 259e8aa

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

app/spicedb/getting-started/faq/page.mdx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,20 @@ For these scenarios, SpiceDB supports [Caveats] as a light-weight form of policy
4646
[Reverse Indices]: ../concepts/zanzibar/#reverse-indices
4747
[caveats]: ../concepts/caveats
4848

49+
## How do I filter resources based on access decisions in SpiceDB?
50+
51+
There are three approaches for filtering resources based on whether users have access to them:
52+
53+
1. **LookupResources** - Use when the number of accessible resources is relatively small. Call `LookupResources` to get all resource IDs the user can access, then use those IDs as a filter in your database query (e.g., `WHERE id = ANY(ARRAY[...])`). This is the simplest approach and a good starting point.
54+
55+
2. **CheckBulkPermissions** - Use when accessible resources are too large for LookupResources. Fetch a page of candidate results from your database, then call `CheckBulkPermissions` to determine which ones the user can access. Keep iterating until you have a full page of permitted results. This works well with cursor-based pagination and search interfaces.
56+
57+
3. **Materialize** (Early Access) - For maximum scalability with large datasets or high traffic. Materialize watches permission changes in SpiceDB and maintains a local denormalized view of user permissions, allowing you to use simple database JOINs for filtering.
58+
59+
Choose based on your scale: start with LookupResources, move to CheckBulkPermissions when needed, and consider Materialize for the highest performance requirements. [Learn more]
60+
61+
[Learn more]: ../modeling/protecting-a-list-endpoint
62+
4963
## How can I get involved with SpiceDB?
5064

5165
The best first step is to join [Discord].

0 commit comments

Comments
 (0)