Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/access-control/collections.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,11 @@ export const CollectionWithVersionsAccess: CollectionConfig = {
}
```

<Banner type="warning">
**Note:** Returning a [Query](../queries/overview) will apply the constraint to the
[`versions` collection](../versions/overview#database-impact), not the original Collection.
</Banner>

The following arguments are provided to the `readVersions` function:

| Option | Description |
Expand Down
7 changes: 6 additions & 1 deletion docs/access-control/globals.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ The following arguments are provided to the `update` function:

If the Global has [Versions](../versions/overview) enabled, the `readVersions` Access Control function determines whether or not the currently logged in user can access the version history of a Document.

To add Read Versions Access Control to a Collection, use the `readVersions` property in the [Global Config](../configuration/globals):
To add Read Versions Access Control to a Global, use the `readVersions` property in the [Global Config](../configuration/globals):

```ts
import type { GlobalConfig } from 'payload'
Expand All @@ -136,6 +136,11 @@ export const GlobalWithVersionsAccess: GlobalConfig = {
}
```

<Banner type="warning">
**Note:** Returning a [Query](../queries/overview) will apply the constraint to the
[`versions` collection](../versions/overview#database-impact), not the original Global.
</Banner>

The following arguments are provided to the `readVersions` function:

| Option | Description |
Expand Down