Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: role authorization for create project button in project empty state #3204

Merged
merged 1 commit into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading