mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2024-12-28 09:38:56 +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
|
||||
if (payload.permissions) {
|
||||
for (const key in payload.permissions) {
|
||||
@ -198,8 +199,15 @@ class User {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 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.join(',') !== this.librariesAccessible.join(',')) {
|
||||
hasUpdates = true
|
||||
@ -211,8 +219,14 @@ class User {
|
||||
}
|
||||
}
|
||||
|
||||
// Update accessible libraries
|
||||
if (payload.itemTagsAccessible !== undefined) {
|
||||
// Update accessible tags
|
||||
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.join(',') !== this.itemTagsAccessible.join(',')) {
|
||||
hasUpdates = true
|
||||
|
Loading…
Reference in New Issue
Block a user