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

This commit is contained in:
elmuffo 2023-04-02 09:01:05 +12:00 committed by GitHub
parent eb59456e78
commit bb5bf0277a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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() };
}
}
}