From 8806a67d083d9964ec8a74decebfd40b67574eec Mon Sep 17 00:00:00 2001 From: Aaryan Khandelwal Date: Thu, 21 Nov 2024 15:10:44 +0530 Subject: [PATCH] fix: auth for access change and delete --- web/core/components/pages/dropdowns/actions.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/core/components/pages/dropdowns/actions.tsx b/web/core/components/pages/dropdowns/actions.tsx index 51b288c0ea..d5bd50835d 100644 --- a/web/core/components/pages/dropdowns/actions.tsx +++ b/web/core/components/pages/dropdowns/actions.tsx @@ -84,7 +84,7 @@ export const PageActions: React.FC = observer((props) => { action: pageOperations.toggleAccess, title: access === EPageAccess.PUBLIC ? "Make private" : "Make public", icon: access === EPageAccess.PUBLIC ? Lock : Globe2, - shouldRender: canCurrentUserChangeAccess, + shouldRender: canCurrentUserChangeAccess && !archived_at, }, { key: "open-in-new-tab", @@ -119,7 +119,7 @@ export const PageActions: React.FC = observer((props) => { action: () => setDeletePageModal(true), title: "Delete", icon: Trash2, - shouldRender: canCurrentUserDeletePage, + shouldRender: canCurrentUserDeletePage && !!archived_at, }, {