Browse Source

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`).
pjeanjean 6 years ago
parent
commit
7919dd81da
2 changed files with 2 additions and 1 deletions
  1. 1 0
      CONTRIBUTORS.md
  2. 1 1
      MediaBrowser.Api/UserLibrary/ItemsService.cs

+ 1 - 0
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
 

+ 1 - 1
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<BaseItem>