File tree Expand file tree Collapse file tree 4 files changed +11
-11
lines changed Expand file tree Collapse file tree 4 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -98,8 +98,7 @@ export const Account: React.FC<AdminViewProps> = async ({
98
98
id : user . id ,
99
99
collectionConfig,
100
100
isEditing : true ,
101
- payload : req . payload ,
102
- user,
101
+ req,
103
102
} )
104
103
105
104
// Get all versions required for UI
Original file line number Diff line number Diff line change 1
1
import type {
2
- Payload ,
2
+ PayloadRequest ,
3
3
SanitizedCollectionConfig ,
4
4
SanitizedGlobalConfig ,
5
5
TypedUser ,
@@ -11,8 +11,7 @@ type Args = {
11
11
globalConfig ?: SanitizedGlobalConfig
12
12
id ?: number | string
13
13
isEditing : boolean
14
- payload : Payload
15
- user : TypedUser
14
+ req : PayloadRequest
16
15
}
17
16
18
17
type Result = Promise < {
@@ -26,8 +25,7 @@ export const getIsLocked = async ({
26
25
collectionConfig,
27
26
globalConfig,
28
27
isEditing,
29
- payload,
30
- user,
28
+ req,
31
29
} : Args ) : Result => {
32
30
const entityConfig = collectionConfig || globalConfig
33
31
@@ -61,17 +59,19 @@ export const getIsLocked = async ({
61
59
]
62
60
}
63
61
64
- const { docs } = await payload . find ( {
62
+ const { docs } = await req . payload . find ( {
65
63
collection : 'payload-locked-documents' ,
66
64
depth : 1 ,
65
+ overrideAccess : false ,
66
+ req,
67
67
where,
68
68
} )
69
69
70
70
if ( docs . length > 0 ) {
71
71
const newEditor = docs [ 0 ] . user ?. value
72
72
const lastUpdateTime = new Date ( docs [ 0 ] . updatedAt ) . getTime ( )
73
73
74
- if ( newEditor ?. id !== user . id ) {
74
+ if ( newEditor ?. id !== req . user . id ) {
75
75
return {
76
76
currentEditor : newEditor ,
77
77
isLocked : true ,
Original file line number Diff line number Diff line change @@ -126,8 +126,7 @@ export const renderDocument = async ({
126
126
collectionConfig,
127
127
globalConfig,
128
128
isEditing,
129
- payload : req . payload ,
130
- user,
129
+ req,
131
130
} ) ,
132
131
] )
133
132
Original file line number Diff line number Diff line change @@ -61,7 +61,9 @@ export const handleFormStateLocking = async ({
61
61
collection : 'payload-locked-documents' ,
62
62
depth : 1 ,
63
63
limit : 1 ,
64
+ overrideAccess : false ,
64
65
pagination : false ,
66
+ req,
65
67
where : lockedDocumentQuery ,
66
68
} )
67
69
You can’t perform that action at this time.
0 commit comments