mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-08-31 15:19:34 +02:00
Update:Only show podcast search page for admin or up #225
This commit is contained in:
parent
379fa21571
commit
b521f37ec1
2 changed files with 11 additions and 4 deletions
|
@ -25,6 +25,9 @@ export default {
|
||||||
userHasPlaylists() {
|
userHasPlaylists() {
|
||||||
return this.$store.state.libraries.numUserPlaylists
|
return this.$store.state.libraries.numUserPlaylists
|
||||||
},
|
},
|
||||||
|
userIsAdminOrUp() {
|
||||||
|
return this.$store.getters['user/getIsAdminOrUp']
|
||||||
|
},
|
||||||
items() {
|
items() {
|
||||||
let items = []
|
let items = []
|
||||||
if (this.isPodcast) {
|
if (this.isPodcast) {
|
||||||
|
@ -52,16 +55,19 @@ export default {
|
||||||
icon: this.currentLibraryIcon,
|
icon: this.currentLibraryIcon,
|
||||||
iconClass: 'text-lg',
|
iconClass: 'text-lg',
|
||||||
text: 'Library'
|
text: 'Library'
|
||||||
},
|
}
|
||||||
{
|
]
|
||||||
|
|
||||||
|
if (this.userIsAdminOrUp) {
|
||||||
|
items.push({
|
||||||
to: '/bookshelf/search',
|
to: '/bookshelf/search',
|
||||||
routeName: 'bookshelf-search',
|
routeName: 'bookshelf-search',
|
||||||
iconPack: 'abs-icons',
|
iconPack: 'abs-icons',
|
||||||
icon: 'podcast',
|
icon: 'podcast',
|
||||||
iconClass: 'text-lg',
|
iconClass: 'text-lg',
|
||||||
text: 'Search'
|
text: 'Search'
|
||||||
|
})
|
||||||
}
|
}
|
||||||
]
|
|
||||||
} else {
|
} else {
|
||||||
items = [
|
items = [
|
||||||
{
|
{
|
||||||
|
|
|
@ -16,6 +16,7 @@ export const state = () => ({
|
||||||
|
|
||||||
export const getters = {
|
export const getters = {
|
||||||
getIsRoot: (state) => state.user && state.user.type === 'root',
|
getIsRoot: (state) => state.user && state.user.type === 'root',
|
||||||
|
getIsAdminOrUp: (state) => state.user && (state.user.type === 'admin' || state.user.type === 'root'),
|
||||||
getToken: (state) => {
|
getToken: (state) => {
|
||||||
return state.user ? state.user.token : null
|
return state.user ? state.user.token : null
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue