mirror of
				https://github.com/advplyr/audiobookshelf.git
				synced 2025-11-03 19:07:00 -05:00 
			
		
		
		
	Merge pull request #3368 from nichwall/fix_tag_permissions
Fix tag permissions
This commit is contained in:
		
						commit
						f194c5be0e
					
				@ -270,8 +270,10 @@ class UserController {
 | 
			
		||||
      const permissions = {
 | 
			
		||||
        ...user.permissions
 | 
			
		||||
      }
 | 
			
		||||
      const defaultPermissions = Database.userModel.getDefaultPermissionsForUserType(updatePayload.type || user.type || 'user')
 | 
			
		||||
      for (const key in updatePayload.permissions) {
 | 
			
		||||
        if (permissions[key] !== undefined) {
 | 
			
		||||
        // Check that the key is a valid permission key or is included in the default permissions
 | 
			
		||||
        if (permissions[key] !== undefined || defaultPermissions[key] !== undefined) {
 | 
			
		||||
          if (typeof updatePayload.permissions[key] !== 'boolean') {
 | 
			
		||||
            Logger.warn(`[UserController] update: Invalid permission value for key ${key}. Should be boolean`)
 | 
			
		||||
          } else if (permissions[key] !== updatePayload.permissions[key]) {
 | 
			
		||||
 | 
			
		||||
@ -108,6 +108,7 @@ class User extends Model {
 | 
			
		||||
      accessAllLibraries: true,
 | 
			
		||||
      accessAllTags: true,
 | 
			
		||||
      accessExplicitContent: true,
 | 
			
		||||
      selectedTagsNotAccessible: false,
 | 
			
		||||
      librariesAccessible: [],
 | 
			
		||||
      itemTagsSelected: []
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user