mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2024-12-30 18:48:55 +01:00
Fix:Setting user can access all libraries/tags
This commit is contained in:
parent
4185807da4
commit
09d0d47549
@ -189,6 +189,7 @@ class User {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
// And update permissions
|
// And update permissions
|
||||||
if (payload.permissions) {
|
if (payload.permissions) {
|
||||||
for (const key in payload.permissions) {
|
for (const key in payload.permissions) {
|
||||||
@ -198,8 +199,15 @@ class User {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update accessible libraries
|
// Update accessible libraries
|
||||||
if (payload.librariesAccessible !== undefined) {
|
if (this.permissions.accessAllLibraries) {
|
||||||
|
// Access all libraries
|
||||||
|
if (this.librariesAccessible.length) {
|
||||||
|
this.librariesAccessible = []
|
||||||
|
hasUpdates = true
|
||||||
|
}
|
||||||
|
} else if (payload.librariesAccessible !== undefined) {
|
||||||
if (payload.librariesAccessible.length) {
|
if (payload.librariesAccessible.length) {
|
||||||
if (payload.librariesAccessible.join(',') !== this.librariesAccessible.join(',')) {
|
if (payload.librariesAccessible.join(',') !== this.librariesAccessible.join(',')) {
|
||||||
hasUpdates = true
|
hasUpdates = true
|
||||||
@ -211,8 +219,14 @@ class User {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update accessible libraries
|
// Update accessible tags
|
||||||
if (payload.itemTagsAccessible !== undefined) {
|
if (this.permissions.accessAllTags) {
|
||||||
|
// Access all tags
|
||||||
|
if (this.itemTagsAccessible.length) {
|
||||||
|
this.itemTagsAccessible = []
|
||||||
|
hasUpdates = true
|
||||||
|
}
|
||||||
|
} else if (payload.itemTagsAccessible !== undefined) {
|
||||||
if (payload.itemTagsAccessible.length) {
|
if (payload.itemTagsAccessible.length) {
|
||||||
if (payload.itemTagsAccessible.join(',') !== this.itemTagsAccessible.join(',')) {
|
if (payload.itemTagsAccessible.join(',') !== this.itemTagsAccessible.join(',')) {
|
||||||
hasUpdates = true
|
hasUpdates = true
|
||||||
|
Loading…
Reference in New Issue
Block a user