aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/UserLibrary/ItemsService.cs
diff options
context:
space:
mode:
authordkanada <dkanada@users.noreply.github.com>2020-04-11 20:10:16 +0900
committerdkanada <dkanada@users.noreply.github.com>2020-04-11 20:10:16 +0900
commitbd55bdb4e3ff4555a722321f92a4783f913204f3 (patch)
tree1cdfcd2c8da8bfc79922c3bacf17d87ae448b701 /MediaBrowser.Api/UserLibrary/ItemsService.cs
parentcbe1fe2c8f82af2233201203367ba8a532dbec8b (diff)
parent299541f1b26136ef89741f28c7949cda4e5e485f (diff)
merge branch master into plugin
Diffstat (limited to 'MediaBrowser.Api/UserLibrary/ItemsService.cs')
-rw-r--r--MediaBrowser.Api/UserLibrary/ItemsService.cs7
1 files changed, 5 insertions, 2 deletions
diff --git a/MediaBrowser.Api/UserLibrary/ItemsService.cs b/MediaBrowser.Api/UserLibrary/ItemsService.cs
index c7b505171..22e4eea0b 100644
--- a/MediaBrowser.Api/UserLibrary/ItemsService.cs
+++ b/MediaBrowser.Api/UserLibrary/ItemsService.cs
@@ -213,7 +213,10 @@ namespace MediaBrowser.Api.UserLibrary
request.IncludeItemTypes = "Playlist";
}
- bool isInEnabledFolder = user.Policy.EnabledFolders.Any(i => new Guid(i) == item.Id);
+ bool isInEnabledFolder = user.Policy.EnabledFolders.Any(i => new Guid(i) == item.Id)
+ // Assume all folders inside an EnabledChannel are enabled
+ || user.Policy.EnabledChannels.Any(i => new Guid(i) == item.Id);
+
var collectionFolders = _libraryManager.GetCollectionFolders(item);
foreach (var collectionFolder in collectionFolders)
{
@@ -225,7 +228,7 @@ namespace MediaBrowser.Api.UserLibrary
}
}
- if (!(item is UserRootFolder) && !user.Policy.EnableAllFolders && !isInEnabledFolder)
+ if (!(item is UserRootFolder) && !user.Policy.EnableAllFolders && !isInEnabledFolder && !user.Policy.EnableAllChannels)
{
Logger.LogWarning("{UserName} is not permitted to access Library {ItemName}.", user.Name, item.Name);
return new QueryResult<BaseItem>