mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-05 15:04:56 +02:00
Adding upload permission to users, directory structure readme update
This commit is contained in:
parent
07994d38d5
commit
c884fd6880
12 changed files with 148 additions and 75 deletions
|
@ -32,6 +32,9 @@ class User {
|
|||
get canDownload() {
|
||||
return !!this.permissions.download && this.isActive
|
||||
}
|
||||
get canUpload() {
|
||||
return !!this.permissions.upload && this.isActive
|
||||
}
|
||||
|
||||
getDefaultUserSettings() {
|
||||
return {
|
||||
|
@ -47,7 +50,8 @@ class User {
|
|||
return {
|
||||
download: true,
|
||||
update: true,
|
||||
delete: this.id === 'root'
|
||||
delete: this.type === 'root',
|
||||
upload: this.type === 'root' || this.type === 'admin'
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -112,6 +116,8 @@ class User {
|
|||
this.createdAt = user.createdAt || Date.now()
|
||||
this.settings = user.settings || this.getDefaultUserSettings()
|
||||
this.permissions = user.permissions || this.getDefaultUserPermissions()
|
||||
// Upload permission added v1.1.13, make sure root user has upload permissions
|
||||
if (this.type === 'root' && !this.permissions.upload) this.permissions.upload = true
|
||||
}
|
||||
|
||||
update(payload) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue