Browse Source

Implement check to hide all libraries when user has no access (#9536)

elmuffo 2 years ago
parent
commit
bb5bf0277a
1 changed files with 6 additions and 0 deletions
  1. 6 0
      Emby.Server.Implementations/Library/LibraryManager.cs

+ 6 - 0
Emby.Server.Implementations/Library/LibraryManager.cs

@@ -1503,6 +1503,12 @@ namespace Emby.Server.Implementations.Library
                 });
 
                 query.TopParentIds = userViews.SelectMany(i => GetTopParentIdsForQuery(i, user)).ToArray();
+
+                // Prevent searching in all libraries due to empty filter
+                if (query.TopParentIds.Length == 0)
+                {
+                    query.TopParentIds = new[] { Guid.NewGuid() };
+                }
             }
         }