fix: locked documents with read access for users (#8950)
### What? When read access is restricted on the `users` collection - restricted users would not have access to other users complete user data object only their IDs when accessing `user.value`. ### Why? This is problematic when determining the lock status of a document from a restricted users perspective as `user.id` would not exist - the user data would not be an object in this case but instead a `string` or `number` value for user ID ### How? This PR properly handles both cases now and checks if the incoming user data is an object or just a `string` / `number`.
This commit is contained in:
@@ -17,7 +17,7 @@ const baseClass = 'dashboard'
|
||||
|
||||
export type DashboardProps = {
|
||||
globalData: Array<{
|
||||
data: { _isLocked: boolean; _lastEditedAt: string; _userEditing: ClientUser | null }
|
||||
data: { _isLocked: boolean; _lastEditedAt: string; _userEditing: ClientUser | number | string }
|
||||
lockDuration?: number
|
||||
slug: string
|
||||
}>
|
||||
|
||||
Reference in New Issue
Block a user