Fix:User permissions for collection API routes and UI #951

This commit is contained in:
advplyr 2022-08-31 15:46:10 -05:00
parent e362456895
commit 8ec4bd4279
8 changed files with 70 additions and 50 deletions

View file

@ -19,9 +19,9 @@
{{ streaming ? 'Streaming' : 'Play' }}
</ui-btn>
<ui-icon-btn icon="edit" class="mx-0.5" @click="editClick" />
<ui-icon-btn v-if="userCanUpdate" icon="edit" class="mx-0.5" @click="editClick" />
<ui-icon-btn icon="delete" class="mx-0.5" @click="removeClick" />
<ui-icon-btn v-if="userCanDelete" icon="delete" class="mx-0.5" @click="removeClick" />
</div>
<div class="my-8 max-w-2xl">
@ -92,6 +92,12 @@ export default {
},
showPlayButton() {
return this.playableBooks.length
},
userCanUpdate() {
return this.$store.getters['user/getUserCanUpdate']
},
userCanDelete() {
return this.$store.getters['user/getUserCanDelete']
}
},
methods: {