Skip to content

Commit 823bda2

Browse files
authored
fix(ui): show dot menu when editMenuItems exist regardless of create/delete permission (#16989)
Fixes #16975 ## What? `editMenuItems` defined on a collection were silently hidden when both `create` and `delete` permissions were denied, because the three-dot menu's visibility (`showDotMenu`) was gated entirely on those permissions. ## Why? Custom `editMenuItems` represent arbitrary business logic unrelated to CRUD operations. A collection that blocks creation (e.g. webhook-only) and deletion (e.g. audit trail) should still expose custom actions like "Resend confirmation email". ## How? Added `EditMenuItems` as an additional condition in `showDotMenu` so the popup renders whenever custom items are present, regardless of create/delete access.
1 parent 8dfb802 commit 823bda2

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

  • packages/ui/src/elements/DocumentControls

packages/ui/src/elements/DocumentControls/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,8 @@ export const DocumentControls: React.FC<{
198198

199199
const showDotMenu = Boolean(
200200
!disableActions &&
201-
((collectionConfig && id && (hasCreatePermission || hasDeletePermission)) ||
201+
(EditMenuItems ||
202+
(collectionConfig && id && (hasCreatePermission || hasDeletePermission)) ||
202203
(globalConfig && (globalHasDraftsEnabled || localization))),
203204
)
204205
const collectionAutosaveEnabled = hasAutosaveEnabled(collectionConfig)
@@ -424,7 +425,7 @@ export const DocumentControls: React.FC<{
424425
)}
425426
</React.Fragment>
426427
)}
427-
{hasDeletePermission && (
428+
{hasDeletePermission && id && (
428429
<DeleteDocument
429430
buttonId="action-delete"
430431
collectionSlug={collectionConfig?.slug}

0 commit comments

Comments
 (0)