From 9e49e8764640a6bea4441e047a47036cf2fa93d8 Mon Sep 17 00:00:00 2001 From: Joseph Chiang Date: Mon, 16 Jun 2025 18:02:53 +1000 Subject: [PATCH] fix: correct inverted permission checks for create buttons (fix #12581) (#12614) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary This PR fixes inverted permission checks that were preventing authorized users from seeing "Add New" and "Add note" buttons while showing them to unauthorized users. ## Changes - Fixed permission check in `SingleRecordPickerMenuItemsWithSearch` component (2 locations) - Fixed permission check in `Notes` component ## Issue These permission checks were incorrectly using `\!hasObjectUpdatePermissions` (NOT has permissions) when they should have been checking `hasObjectUpdatePermissions` (has permissions). This is similar to the issue mentioned in PR #12437. ## Test plan - [ ] Verify that users WITH update permissions can see the "Add New" button in record pickers - [ ] Verify that users WITHOUT update permissions cannot see the "Add New" button - [ ] Verify that users WITH update permissions can see the "Add note" button in Notes component - [ ] Verify that users WITHOUT update permissions cannot see the "Add note" button 🤖 Generated with Claude Code (https://claude.ai/code) Co-authored-by: Claude --- .../src/modules/activities/notes/components/Notes.tsx | 2 +- .../components/SingleRecordPickerMenuItemsWithSearch.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/twenty-front/src/modules/activities/notes/components/Notes.tsx b/packages/twenty-front/src/modules/activities/notes/components/Notes.tsx index 7a60a123f..bc0d7a0d5 100644 --- a/packages/twenty-front/src/modules/activities/notes/components/Notes.tsx +++ b/packages/twenty-front/src/modules/activities/notes/components/Notes.tsx @@ -90,7 +90,7 @@ export const Notes = ({ title="All" notes={notes} button={ - !hasObjectUpdatePermissions && ( + hasObjectUpdatePermissions && (