Skip to content

Commit 5c82966

Browse files
committed
fix(create-project): only show the button when users have permission for the selected unit
1 parent 3bd9c25 commit 5c82966

File tree

1 file changed

+3
-1
lines changed
  • features/userSettings/UserSettingsContent/ContextSection/contextActions

1 file changed

+3
-1
lines changed

features/userSettings/UserSettingsContent/ContextSection/contextActions/UnitActions.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ export const UnitActions = () => {
2323
<DeleteUnitListItem unit={unit} onDelete={() => setUnit(undefined)} />
2424
)}
2525
{isUnitOwner && unit && organisation?.name !== "Default" && <EditUnitListItem unit={unit} />}
26-
{unit && <CreateProjectListItem unit={unit} />}
26+
{unit && (unit.caller_is_member || unit.owner_id === user.username) && (
27+
<CreateProjectListItem unit={unit} />
28+
)}
2729
</List>
2830
);
2931
};

0 commit comments

Comments
 (0)