Skip to content

Commit

Permalink
fix: hide request button to anauthorized account
Browse files Browse the repository at this point in the history
Signed-off-by: Samuelson Brito <samuelsonma@gmail.com>
  • Loading branch information
samuelsonbrito committed Feb 11, 2025
1 parent 1fc1fa0 commit e6810cc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/Components/Request/RequestPicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
- SPDX-License-Identifier: AGPL-3.0-or-later
-->
<template>
<div>
<div v-if="canRequestSign">
<NcActions :menu-name="t('libresign', 'Request')"
:inline="inline ? 3 : 0"
:force-name="inline"
Expand Down Expand Up @@ -80,6 +80,7 @@ import UploadIcon from 'vue-material-design-icons/Upload.vue'
import axios from '@nextcloud/axios'
import { showError } from '@nextcloud/dialogs'
import { FilePickerVue as FilePicker } from '@nextcloud/dialogs/filepicker.js'
import { loadState } from '@nextcloud/initial-state'
import { generateOcsUrl } from '@nextcloud/router'

import NcActionButton from '@nextcloud/vue/dist/Components/NcActionButton.js'
Expand Down Expand Up @@ -140,6 +141,7 @@ export default {
showingFilePicker: false,
loading: false,
openedMenu: false,
canRequestSign: loadState('libresign', 'can_request_sign', false),
}
},
computed: {
Expand Down
4 changes: 3 additions & 1 deletion src/views/FilesList/FilesList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
:name="t('libresign', 'Loading …')" />
<NcEmptyContent v-else-if="!loading && isEmptyDir && filtersStore.activeChips.length === 0"
:name="t('libresign', 'There are no documents')"
:description="t('libresign', 'Choose the file to request signatures.')">
:description="canRequestSign ? t('libresign', 'Choose the file to request signatures.') : ''">
<template #action>
<RequestPicker />
</template>
Expand All @@ -66,6 +66,7 @@ import ListViewIcon from 'vue-material-design-icons/FormatListBulletedSquare.vue
import ViewGridIcon from 'vue-material-design-icons/ViewGrid.vue'

import { subscribe, unsubscribe } from '@nextcloud/event-bus'
import { loadState } from '@nextcloud/initial-state'

import NcAppContent from '@nextcloud/vue/dist/Components/NcAppContent.js'
import NcBreadcrumb from '@nextcloud/vue/dist/Components/NcBreadcrumb.js'
Expand Down Expand Up @@ -112,6 +113,7 @@ export default {
return {
loading: true,
dirContentsFiltered: [],
canRequestSign: loadState('libresign', 'can_request_sign', false),
}
},
computed: {
Expand Down

0 comments on commit e6810cc

Please sign in to comment.