mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-07 10:14:14 -04:00
Fix media folders endpoint access control
This commit is contained in:
parent
6c8b40f413
commit
4f3d562d75
@ -11,6 +11,7 @@ using System.Threading.Tasks;
|
||||
using Jellyfin.Api.Attributes;
|
||||
using Jellyfin.Api.Constants;
|
||||
using Jellyfin.Api.Extensions;
|
||||
using Jellyfin.Api.Helpers;
|
||||
using Jellyfin.Api.ModelBinders;
|
||||
using Jellyfin.Api.Models.LibraryDtos;
|
||||
using Jellyfin.Data.Entities;
|
||||
@ -498,6 +499,12 @@ namespace Jellyfin.Api.Controllers
|
||||
{
|
||||
var items = _libraryManager.GetUserRootFolder().Children.Concat(_libraryManager.RootFolder.VirtualChildren).OrderBy(i => i.SortName).ToList();
|
||||
|
||||
if (!ClaimHelpers.GetIsApiKey(User) && !User.IsInRole(UserRoles.Administrator))
|
||||
{
|
||||
var user = _userManager.GetUserById(ClaimHelpers.GetUserId(User)!.Value);
|
||||
items = items.Where(i => i.IsVisible(user)).ToList();
|
||||
}
|
||||
|
||||
if (isHidden.HasValue)
|
||||
{
|
||||
var val = isHidden.Value;
|
||||
|
Loading…
x
Reference in New Issue
Block a user