Skip to content

Commit

Permalink
[BUGFIX] Show Import data if user is admin or owner (#5688)
Browse files Browse the repository at this point in the history
FIx #5686
  • Loading branch information
leiyre authored Nov 18, 2024
1 parent 31b3c6a commit f9ab910
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
>
<template slot="dialog-cta" v-if="dataset && dataset.createdFromUI">
<ImportData
v-if="isAdminOrOwner"
:snippet="dataset.createCodeSnippetFromHub(getUser())"
/>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ import { useDatasetViewModel } from "../useDatasetViewModel";
import { GetDatasetByIdUseCase } from "@/v1/domain/usecases/get-dataset-by-id-use-case";
import { useDataset } from "@/v1/infrastructure/storage/DatasetStorage";
import { RecordCriteria } from "~/v1/domain/entities/record/RecordCriteria";
import { useRoutes, useUser } from "~/v1/infrastructure/services";
import { useRoutes, useUser, useRole } from "~/v1/infrastructure/services";
import { RecordStatus } from "~/v1/domain/entities/record/RecordAnswer";

export const useAnnotationModeViewModel = () => {
const { isAdminOrOwner } = useRole();
const router = useRouter();
const routes = useRoutes();
const { getUser } = useUser();
Expand Down Expand Up @@ -113,5 +114,6 @@ export const useAnnotationModeViewModel = () => {
breadcrumbs,
updateQueryParams,
getUser,
isAdminOrOwner,
};
};

0 comments on commit f9ab910

Please sign in to comment.