diff --git a/components/home/BookshelfNavBar.vue b/components/home/BookshelfNavBar.vue index 3df98e14..8706236b 100644 --- a/components/home/BookshelfNavBar.vue +++ b/components/home/BookshelfNavBar.vue @@ -25,6 +25,9 @@ export default { userHasPlaylists() { return this.$store.state.libraries.numUserPlaylists }, + userIsAdminOrUp() { + return this.$store.getters['user/getIsAdminOrUp'] + }, items() { let items = [] if (this.isPodcast) { @@ -52,16 +55,19 @@ export default { icon: this.currentLibraryIcon, iconClass: 'text-lg', text: 'Library' - }, - { + } + ] + + if (this.userIsAdminOrUp) { + items.push({ to: '/bookshelf/search', routeName: 'bookshelf-search', iconPack: 'abs-icons', icon: 'podcast', iconClass: 'text-lg', text: 'Search' - } - ] + }) + } } else { items = [ { diff --git a/store/user.js b/store/user.js index 7ae96ebd..8981e557 100644 --- a/store/user.js +++ b/store/user.js @@ -16,6 +16,7 @@ export const state = () => ({ export const getters = { getIsRoot: (state) => state.user && state.user.type === 'root', + getIsAdminOrUp: (state) => state.user && (state.user.type === 'admin' || state.user.type === 'root'), getToken: (state) => { return state.user ? state.user.token : null },