Skip to content

Commit c27751d

Browse files
authored
feat: auth check (#815)
1 parent b9952e8 commit c27751d

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

packages/studio-base/src/components/AppBar/CoSceneLayoutButton/CoSceneLayoutRow.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -380,8 +380,9 @@ export default React.memo(function LayoutRow({
380380
layoutIsShared(layout) &&
381381
onRecommendedToProjectLayout != undefined &&
382382
!layout.isRecordRecommended &&
383-
(currentUserRole.organizationRole >=
384-
OrganizationRoleWeight[OrganizationRoleEnum.ORGANIZATION_ADMIN] ||
383+
((currentUserRole.organizationRole >=
384+
OrganizationRoleWeight[OrganizationRoleEnum.ORGANIZATION_ADMIN] &&
385+
currentUserRole.projectRole > ProjectRoleWeight[ProjectRoleEnum.AUTHENTICATED_USER]) ||
385386
currentUserRole.projectRole >= ProjectRoleWeight[ProjectRoleEnum.PROJECT_ADMIN]) && {
386387
type: "item",
387388
key: "recommendedToProjectLayout",
@@ -393,8 +394,9 @@ export default React.memo(function LayoutRow({
393394
},
394395
onCopyToRecordDefaultLayout != undefined &&
395396
!layout.isRecordRecommended &&
396-
(currentUserRole.organizationRole >=
397-
OrganizationRoleWeight[OrganizationRoleEnum.ORGANIZATION_READER] ||
397+
((currentUserRole.organizationRole >=
398+
OrganizationRoleWeight[OrganizationRoleEnum.ORGANIZATION_READER] &&
399+
currentUserRole.projectRole > ProjectRoleWeight[ProjectRoleEnum.AUTHENTICATED_USER]) ||
398400
currentUserRole.projectRole >= ProjectRoleWeight[ProjectRoleEnum.PROJECT_READER]) &&
399401
baseInfo.recordId != undefined && {
400402
type: "item",

packages/studio-base/src/components/CoSceneEventView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ function EventViewComponent(params: {
356356
<RepeatOneOutlinedIcon fontSize="small" />
357357
</IconButton>
358358

359-
{currentUserRole.projectRole >=
359+
{currentUserRole.projectRole >
360360
ProjectRoleWeight[ProjectRoleEnum.AUTHENTICATED_USER] && (
361361
<IconButton size="small" onClick={handleEditEvent} title={t("editMoment")}>
362362
<EditIcon fontSize="small" />
@@ -367,7 +367,7 @@ function EventViewComponent(params: {
367367
<ShareIcon fontSize="small" />
368368
</IconButton>
369369

370-
{currentUserRole.projectRole >=
370+
{currentUserRole.projectRole >
371371
ProjectRoleWeight[ProjectRoleEnum.AUTHENTICATED_USER] && (
372372
<IconButton size="small" onClick={confirmDelete} title={t("delete")}>
373373
<DeleteIcon fontSize="small" />

packages/studio-base/src/components/PlaybackControls/Scrubber.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ export default function Scrubber(props: Props): React.JSX.Element {
257257
</Stack>
258258
<BagsOverlay />
259259
{enableList.event === "ENABLE" &&
260-
currentUserRole.projectRole >= ProjectRoleWeight[ProjectRoleEnum.AUTHENTICATED_USER] && (
260+
currentUserRole.projectRole > ProjectRoleWeight[ProjectRoleEnum.AUTHENTICATED_USER] && (
261261
<EventsOverlay
262262
componentId={hoverComponentId}
263263
isDragging={isDragging}

packages/studio-base/src/components/PlaybackControls/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ export default function PlaybackControls(props: {
251251
<Stack direction="row" alignItems="center" flex={1} gap={1} overflowX="auto">
252252
<Stack direction="row" flex={1} gap={0.5}>
253253
{enableList.event === "ENABLE" &&
254-
currentUserRole.projectRole >=
254+
currentUserRole.projectRole >
255255
ProjectRoleWeight[ProjectRoleEnum.AUTHENTICATED_USER] && (
256256
<MemoedMomentButton disableControls={disableControls} />
257257
)}

0 commit comments

Comments
 (0)