From 40b8b0ac355fd7b0a04b9553270b5ae0e07964ba Mon Sep 17 00:00:00 2001 From: Lakhan Baheti <94619783+1akhanBaheti@users.noreply.github.com> Date: Wed, 20 Dec 2023 18:53:35 +0530 Subject: [PATCH] fix: role authorization for create project button in project empty state (#3204) --- web/components/page-views/workspace-dashboard.tsx | 3 +-- web/components/project/card-list.tsx | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/web/components/page-views/workspace-dashboard.tsx b/web/components/page-views/workspace-dashboard.tsx index ff378e23d..299c35de9 100644 --- a/web/components/page-views/workspace-dashboard.tsx +++ b/web/components/page-views/workspace-dashboard.tsx @@ -37,8 +37,7 @@ export const WorkspaceDashboardView = observer(() => { workspaceSlug ? `USER_WORKSPACE_DASHBOARD_${workspaceSlug}_${month}` : null, workspaceSlug ? () => userStore.fetchUserDashboardInfo(workspaceSlug.toString(), month) : null ); - - const isEditingAllowed = !!userStore.currentProjectRole && userStore.currentProjectRole >= EUserWorkspaceRoles.MEMBER; + const isEditingAllowed = !!userStore.currentWorkspaceRole && userStore.currentWorkspaceRole >= EUserWorkspaceRoles.MEMBER; const handleTourCompleted = () => { userStore diff --git a/web/components/project/card-list.tsx b/web/components/project/card-list.tsx index 76f3112b6..3ccc403c1 100644 --- a/web/components/project/card-list.tsx +++ b/web/components/project/card-list.tsx @@ -23,12 +23,11 @@ export const ProjectCardList: FC = observer((props) => { project: projectStore, commandPalette: commandPaletteStore, trackEvent: { setTrackElement }, - user: { currentProjectRole }, + user: { currentWorkspaceRole }, } = useMobxStore(); const projects = workspaceSlug ? projectStore.projects[workspaceSlug.toString()] : null; - - const isEditingAllowed = !!currentProjectRole && currentProjectRole >= EUserWorkspaceRoles.MEMBER; + const isEditingAllowed = !!currentWorkspaceRole && currentWorkspaceRole >= EUserWorkspaceRoles.MEMBER; if (!projects) { return (