Filter groups by parental rating
This commit is contained in:
parent
e74832d139
commit
73c19bd281
|
@ -127,18 +127,20 @@ namespace Emby.Server.Implementations.Syncplay
|
||||||
|
|
||||||
private bool HasAccessToItem(User user, Guid itemId)
|
private bool HasAccessToItem(User user, Guid itemId)
|
||||||
{
|
{
|
||||||
|
var item = _libraryManager.GetItemById(itemId);
|
||||||
|
var hasParentalRatingAccess = user.Policy.MaxParentalRating.HasValue ? item.InheritedParentalRatingValue <= user.Policy.MaxParentalRating : true;
|
||||||
|
|
||||||
if (!user.Policy.EnableAllFolders)
|
if (!user.Policy.EnableAllFolders)
|
||||||
{
|
{
|
||||||
var item = _libraryManager.GetItemById(itemId);
|
|
||||||
var collections = _libraryManager.GetCollectionFolders(item).Select(
|
var collections = _libraryManager.GetCollectionFolders(item).Select(
|
||||||
folder => folder.Id.ToString("N", CultureInfo.InvariantCulture)
|
folder => folder.Id.ToString("N", CultureInfo.InvariantCulture)
|
||||||
);
|
);
|
||||||
var intersect = collections.Intersect(user.Policy.EnabledFolders);
|
var intersect = collections.Intersect(user.Policy.EnabledFolders);
|
||||||
return intersect.Count() > 0;
|
return intersect.Count() > 0 && hasParentalRatingAccess;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return true;
|
return hasParentalRatingAccess;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user