Merge branch 'advplyr:master' into master

This commit is contained in:
Lauri Vuorela 2024-10-29 22:08:01 +01:00 committed by GitHub
commit 2fdab39e27
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
35 changed files with 1252 additions and 144 deletions

View file

@ -28,7 +28,7 @@ const { DataTypes, Model } = sequelize
* @property {string} [finishedAt]
* @property {number} [lastUpdate]
* @property {number} [markAsFinishedTimeRemaining]
* @property {number} [markAsFinishedPercentageComplete]
* @property {number} [markAsFinishedPercentComplete]
*/
class User extends Model {
@ -82,6 +82,7 @@ class User extends Model {
canAccessExplicitContent: 'accessExplicitContent',
canAccessAllLibraries: 'accessAllLibraries',
canAccessAllTags: 'accessAllTags',
canCreateEReader: 'createEreader',
tagsAreDenylist: 'selectedTagsNotAccessible',
// Direct mapping for array-based permissions
allowedLibraries: 'librariesAccessible',
@ -122,6 +123,7 @@ class User extends Model {
update: type === 'root' || type === 'admin',
delete: type === 'root',
upload: type === 'root' || type === 'admin',
createEreader: type === 'root' || type === 'admin',
accessAllLibraries: true,
accessAllTags: true,
accessExplicitContent: type === 'root' || type === 'admin',