mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-04-23 21:47:14 -04:00
Fix media folders endpoint access control
This commit is contained in:
parent
6c8b40f413
commit
4f3d562d75
1 changed files with 7 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue