File tree Expand file tree Collapse file tree
apps/data-management/src/pages Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -631,7 +631,7 @@ const { ensureWorkspaceDatastreams } = orchestrationStore
631631
632632const { workspaces } = storeToRefs (useWorkspaceStore ())
633633const { setSelectedWorkspaceById } = useWorkspaceStore ()
634- const { hasPermission, isAdmin, isOwner } = useWorkspacePermissions ()
634+ const { checkPermissionsByWorkspaceId } = useWorkspacePermissions ()
635635
636636// When opened from the orchestration slide-over, default to showing run history.
637637const activePanel = ref <TaskDetailsPanel >(props .embedded ? ' runs' : ' details' )
@@ -651,16 +651,13 @@ const canRunNow = computed(() => {
651651})
652652
653653const canEditTask = computed (() => {
654- const workspace = task .value ?.workspace
655- if (! workspace ) return false
656-
657- const roleName = ` ${workspace .collaboratorRole ?.name ?? ' ' } ` .toLowerCase ()
658- if (isAdmin () || isOwner (workspace ) || roleName === ' editor' ) return true
654+ const workspaceId = task .value ?.workspace ?.id
655+ if (! workspaceId ) return false
659656
660- return hasPermission (
657+ return checkPermissionsByWorkspaceId (
658+ workspaceId ,
661659 PermissionResource .Workspace ,
662- PermissionAction .Edit ,
663- workspace
660+ PermissionAction .Edit
664661 )
665662})
666663const readOnlyTooltip =
You can’t perform that action at this time.
0 commit comments