Skip to content

Commit

Permalink
Merge pull request #2394 from LibreSign/bugfix/can-save
Browse files Browse the repository at this point in the history
Check if current user can change or only sign the file
  • Loading branch information
vitormattos authored Feb 29, 2024
2 parents fc22dcd + c7d71f5 commit 0f86f85
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Components/Request/RequestSignature.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ import { emit, subscribe, unsubscribe } from '@nextcloud/event-bus'
import NcActionButton from '@nextcloud/vue/dist/Components/NcActionButton.js'
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import NcLoadingIcon from '@nextcloud/vue/dist/Components/NcLoadingIcon.js'
import { getCurrentUser } from '@nextcloud/auth'
import Delete from 'vue-material-design-icons/Delete.vue'
import { showError, showSuccess } from '@nextcloud/dialogs'
import { showResponseError } from '../../helpers/errors.js'
Expand Down Expand Up @@ -94,7 +95,10 @@ export default {
},
computed: {
canSave() {
return this.canRequestSign && !this.filesStore.isSigned() && this.filesStore.getFile()?.signers?.length > 0
return this.canRequestSign
&& this.filesStore.getFile().requested_by.uid === getCurrentUser().uid
&& !this.filesStore.isSigned()
&& this.filesStore.getFile()?.signers?.length > 0
},
canSign() {
return !this.filesStore.isSigned()
Expand Down

0 comments on commit 0f86f85

Please sign in to comment.