From 7919dd81da5d17a8799fbc31de2235687c66a5fd Mon Sep 17 00:00:00 2001 From: pjeanjean Date: Tue, 4 Jun 2019 18:35:14 +0200 Subject: [PATCH] Skip user permission checking for UserRootFolder Fix #1436 UserRootFolders are used to represent virtual folders that exist outside of libraries. As such, it doesn't make sense to check if a user has the right to access their library (named `Media Folders`). --- CONTRIBUTORS.md | 1 + MediaBrowser.Api/UserLibrary/ItemsService.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 81857e57c7..c3fcea1e21 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -24,6 +24,7 @@ - [Lynxy](https://github.com/Lynxy) - [fasheng](https://github.com/fasheng) - [ploughpuff](https://github.com/ploughpuff) + - [pjeanjean](https://github.com/pjeanjean) # Emby Contributors diff --git a/MediaBrowser.Api/UserLibrary/ItemsService.cs b/MediaBrowser.Api/UserLibrary/ItemsService.cs index 3c7ad1d0a6..f1ae484922 100644 --- a/MediaBrowser.Api/UserLibrary/ItemsService.cs +++ b/MediaBrowser.Api/UserLibrary/ItemsService.cs @@ -224,7 +224,7 @@ namespace MediaBrowser.Api.UserLibrary request.IncludeItemTypes = "Playlist"; } - if (!user.Policy.EnableAllFolders && !user.Policy.EnabledFolders.Any(i => new Guid(i) == item.Id)) + if (!(item is UserRootFolder) && !user.Policy.EnableAllFolders && !user.Policy.EnabledFolders.Any(i => new Guid(i) == item.Id)) { Logger.LogWarning("{UserName} is not permitted to access Library {ItemName}.", user.Name, item.Name); return new QueryResult