-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Open
Labels
created-by: Contributorstatus: needs-triagePossible bug which hasn't been reproduced yetPossible bug which hasn't been reproduced yet
Description
Describe the Bug
When a project is using blockReferences
and collection-level update
permissions are set to false
, the block content disappears instead of being read-only.
This issue does not occur when using blocks
.
I've narrowed it down to the below code in the BlockRow
component:
if (permissions === true) {
blockPermissions = true
} else {
const permissionsBlockSpecific = permissions?.blocks?.[block.slug]
if (permissionsBlockSpecific === true) {
blockPermissions = true
} else {
blockPermissions = permissionsBlockSpecific?.fields
}
}
When using blocks
, permissions?.blocks
is { title: { fields: [Object], create: true, read: true } }
however when using blockReferences
, permissions?.blocks
is true
, which leaves blockPermissions
set to undefined
.
Link to the code that reproduces this issue
https://github.com/riley-pearce-airteam/eclipse-update-permission-blocks-bug
Reproduction Steps
- Create a new post with a title block.
- Uncomment
update: () => false
for the posts collection. - Notice that the blocks content disappears, it should be visible but not editable instead.
Which area(s) are affected? (Select all that apply)
area: ui
Environment Info
Payload: v3.53.0
Next: 15.5.0
Metadata
Metadata
Assignees
Labels
created-by: Contributorstatus: needs-triagePossible bug which hasn't been reproduced yetPossible bug which hasn't been reproduced yet