# Define custom roles using a visual builder

**Version:** v2026-07-29

**Published:** July 29, 2026

**This is a paid feature**
This feature is available on certain Enterprise plans. [Talk to sales](https://www.sanity.io/contact/sales?ref=docs) to learn more.

Content Resources define the set of documents a custom role grants access to. Now when defining a content resource, a visual builder will autogenerate the necessary GROQ filter based on your deployed schema.

![A filter setup for content resources, comparing a user's 'brand' attribute to a document's 'brand' field, with a generated GROQ query visible.](https://cdn.sanity.io/images/3do82whm/next/c325a3c7921339ff819aa94d901c0d85dc3cd862-966x470.png)

The visual builder takes you through three steps:

1. Set the name and description for this resource
2. Select which document types to match
3. Create filter conditions to match specific documents

When creating a filter, each condition can compare the value of different document fields. Select `User attribute —> document field` to build a filter that dynamically matches documents based on the attributes of users who get assigned this role.

> [!TIP]
> Protip
> If you don’t see the document type you’re looking for (or you’re not given the option to select any document types), then you need to [deploy your studio schema first](https://www.sanity.io/docs/apis-and-sdks/schema-deployment).

