mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-27 03:31:46 +00:00
Update passport init with saved settings & check if OIDC is configured
This commit is contained in:
parent
adae905953
commit
9e913b5e17
4 changed files with 97 additions and 97 deletions
|
|
@ -46,7 +46,7 @@ class User {
|
|||
return !!this.pash && !!this.pash.length
|
||||
}
|
||||
|
||||
getDefaultUserSettings() {
|
||||
static getDefaultUserSettings() {
|
||||
return {
|
||||
mobileOrderBy: 'recent',
|
||||
mobileOrderDesc: true,
|
||||
|
|
@ -60,12 +60,12 @@ class User {
|
|||
}
|
||||
}
|
||||
|
||||
getDefaultUserPermissions() {
|
||||
static getDefaultUserPermissions(type) {
|
||||
return {
|
||||
download: true,
|
||||
update: true,
|
||||
delete: this.type === 'root',
|
||||
upload: this.type === 'root' || this.type === 'admin',
|
||||
download: type !== 'guest',
|
||||
update: type !== 'guest',
|
||||
delete: type === 'root',
|
||||
upload: type === 'root' || type === 'admin',
|
||||
accessAllLibraries: true
|
||||
}
|
||||
}
|
||||
|
|
@ -152,8 +152,8 @@ class User {
|
|||
this.isLocked = user.type === 'root' ? false : !!user.isLocked
|
||||
this.lastSeen = user.lastSeen || null
|
||||
this.createdAt = user.createdAt || Date.now()
|
||||
this.settings = user.settings || this.getDefaultUserSettings()
|
||||
this.permissions = user.permissions || this.getDefaultUserPermissions()
|
||||
this.settings = user.settings || User.getDefaultUserSettings()
|
||||
this.permissions = user.permissions || User.getDefaultUserPermissions(this.type)
|
||||
// Upload permission added v1.1.13, make sure root user has upload permissions
|
||||
if (this.type === 'root' && !this.permissions.upload) this.permissions.upload = true
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue