fix(next): remove toString coercion inside getDocumentPermissions (#10828)

### What?
When the doc permissions were retrieved from the DB, we were coercing
them into strings even when they should not have been.

### Why?
Usage of `id.toString()`

### How?
Remove `id.toString()`. The id will be correct by this point and we
should never coerce id's like this.

Fixes https://github.com/payloadcms/payload/issues/8218
This commit is contained in:
Jarrod Flesch
2025-01-27 14:16:33 -05:00
committed by GitHub
parent 95e81d8d96
commit 9f9919d2c6

View File

@@ -31,7 +31,7 @@ export const getDocumentPermissions = async (args: {
if (collectionConfig) {
try {
docPermissions = await docAccessOperation({
id: id?.toString(),
id,
collection: {
config: collectionConfig,
},
@@ -46,7 +46,7 @@ export const getDocumentPermissions = async (args: {
if (collectionConfig.versions?.drafts) {
hasPublishPermission = await docAccessOperation({
id: id?.toString(),
id,
collection: {
config: collectionConfig,
},