Skip to content

Commit 40b8b0a

Browse files
authored
fix: role authorization for create project button in project empty state (#3204)
1 parent 216a7c8 commit 40b8b0a

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

web/components/page-views/workspace-dashboard.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ export const WorkspaceDashboardView = observer(() => {
3737
workspaceSlug ? `USER_WORKSPACE_DASHBOARD_${workspaceSlug}_${month}` : null,
3838
workspaceSlug ? () => userStore.fetchUserDashboardInfo(workspaceSlug.toString(), month) : null
3939
);
40-
41-
const isEditingAllowed = !!userStore.currentProjectRole && userStore.currentProjectRole >= EUserWorkspaceRoles.MEMBER;
40+
const isEditingAllowed = !!userStore.currentWorkspaceRole && userStore.currentWorkspaceRole >= EUserWorkspaceRoles.MEMBER;
4241

4342
const handleTourCompleted = () => {
4443
userStore

web/components/project/card-list.tsx

+2-3
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,11 @@ export const ProjectCardList: FC<IProjectCardList> = observer((props) => {
2323
project: projectStore,
2424
commandPalette: commandPaletteStore,
2525
trackEvent: { setTrackElement },
26-
user: { currentProjectRole },
26+
user: { currentWorkspaceRole },
2727
} = useMobxStore();
2828

2929
const projects = workspaceSlug ? projectStore.projects[workspaceSlug.toString()] : null;
30-
31-
const isEditingAllowed = !!currentProjectRole && currentProjectRole >= EUserWorkspaceRoles.MEMBER;
30+
const isEditingAllowed = !!currentWorkspaceRole && currentWorkspaceRole >= EUserWorkspaceRoles.MEMBER;
3231

3332
if (!projects) {
3433
return (

0 commit comments

Comments
 (0)