From e346bea17fd97b1f30a6b180ebe5e43dc20e4b6a Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Mon, 18 Sep 2023 15:50:44 +0800 Subject: [PATCH] fix: missing ui permission condition about users Signed-off-by: Ryan Wang --- .../contents/_components/ContributorList.vue | 39 +++++++++++++++++++ .../contents/attachments/AttachmentList.vue | 5 +++ .../contents/pages/DeletedSinglePageList.vue | 23 +---------- .../pages/components/SinglePageListItem.vue | 20 +--------- .../contents/posts/DeletedPostList.vue | 22 +---------- .../entity-fields/ContributorsField.vue | 21 ++-------- 6 files changed, 53 insertions(+), 77 deletions(-) create mode 100644 console/src/modules/contents/_components/ContributorList.vue diff --git a/console/src/modules/contents/_components/ContributorList.vue b/console/src/modules/contents/_components/ContributorList.vue new file mode 100644 index 0000000000..67dd027691 --- /dev/null +++ b/console/src/modules/contents/_components/ContributorList.vue @@ -0,0 +1,39 @@ + + + diff --git a/console/src/modules/contents/attachments/AttachmentList.vue b/console/src/modules/contents/attachments/AttachmentList.vue index 92b9599a19..47f2a5f00a 100644 --- a/console/src/modules/contents/attachments/AttachmentList.vue +++ b/console/src/modules/contents/attachments/AttachmentList.vue @@ -612,6 +612,11 @@ onMounted(() => { }, }" class="text-xs text-gray-500" + :class="{ + 'pointer-events-none': !currentUserHasPermission([ + 'system:users:view', + ]), + }" > {{ attachment.spec.ownerName }} diff --git a/console/src/modules/contents/pages/DeletedSinglePageList.vue b/console/src/modules/contents/pages/DeletedSinglePageList.vue index 4cfc8990a0..38b361a0b8 100644 --- a/console/src/modules/contents/pages/DeletedSinglePageList.vue +++ b/console/src/modules/contents/pages/DeletedSinglePageList.vue @@ -9,7 +9,6 @@ import { VSpace, Dialog, VEmpty, - VAvatar, VEntity, VEntityField, VPageHeader, @@ -22,11 +21,11 @@ import { ref, watch } from "vue"; import type { ListedSinglePage, SinglePage } from "@halo-dev/api-client"; import { apiClient } from "@/utils/api-client"; import { formatDatetime } from "@/utils/date"; -import { RouterLink } from "vue-router"; import cloneDeep from "lodash.clonedeep"; import { usePermission } from "@/utils/permission"; import { useQuery } from "@tanstack/vue-query"; import { useI18n } from "vue-i18n"; +import ContributorList from "../_components/ContributorList.vue"; const { currentUserHasPermission } = usePermission(); const { t } = useI18n(); @@ -338,25 +337,7 @@ watch(