Skip to content

Commit

Permalink
fix: role authorization for create project button in project empty st…
Browse files Browse the repository at this point in the history
…ate (#3204)
  • Loading branch information
1akhanBaheti authored Dec 20, 2023
1 parent 216a7c8 commit 40b8b0a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions web/components/page-views/workspace-dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions web/components/project/card-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,11 @@ export const ProjectCardList: FC<IProjectCardList> = 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 (
Expand Down

0 comments on commit 40b8b0a

Please sign in to comment.