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:
Patrik
2024-10-31 09:23:18 -04:00
committed by GitHub
parent b417c1f61a
commit 55ce8e68fc
56 changed files with 189 additions and 64 deletions

View File

@@ -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
}>