mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-07 03:48:06 +02:00
Merge pull request #2721 from PrplHaz4/patch-2
Separate Channels permissions from All Libraries
This commit is contained in:
commit
3a98ad8255
1 changed files with 5 additions and 2 deletions
|
@ -213,7 +213,10 @@ namespace MediaBrowser.Api.UserLibrary
|
||||||
request.IncludeItemTypes = "Playlist";
|
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);
|
var collectionFolders = _libraryManager.GetCollectionFolders(item);
|
||||||
foreach (var collectionFolder in collectionFolders)
|
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);
|
Logger.LogWarning("{UserName} is not permitted to access Library {ItemName}.", user.Name, item.Name);
|
||||||
return new QueryResult<BaseItem>
|
return new QueryResult<BaseItem>
|
||||||
|
|
Loading…
Reference in a new issue