Fix media folders endpoint access control

This commit is contained in:
Bill Thornton 2022-11-09 18:31:30 -05:00
parent fb9023f2d8
commit 9f352ccb5b

View File

@ -491,6 +491,12 @@ namespace Jellyfin.Api.Controllers
{
var items = _libraryManager.GetUserRootFolder().Children.Concat(_libraryManager.RootFolder.VirtualChildren).OrderBy(i => i.SortName).ToList();
if (!User.GetIsApiKey() && !User.IsInRole(UserRoles.Administrator))
{
var user = _userManager.GetUserById(User.GetUserId());
items = items.Where(i => i.IsVisible(user)).ToList();
}
if (isHidden.HasValue)
{
var val = isHidden.Value;