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

This commit is contained in:
elmuffo authored and GitHub committed 2023-04-01 15:01:05 -06:00
1 parent eb59456e78
commit bb5bf0277a
1 file changed
+6
@@ -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() };
}
}
}