From b57ace7888db78a655a00a277e7eb5c4a4eba294 Mon Sep 17 00:00:00 2001 From: Ionut Andrei Oanca Date: Mon, 30 Nov 2020 10:03:42 +0100 Subject: Address requested changes from review --- .../SyncPlay/GroupController.cs | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) (limited to 'Emby.Server.Implementations/SyncPlay/GroupController.cs') diff --git a/Emby.Server.Implementations/SyncPlay/GroupController.cs b/Emby.Server.Implementations/SyncPlay/GroupController.cs index dc262f1cf..16acae99e 100644 --- a/Emby.Server.Implementations/SyncPlay/GroupController.cs +++ b/Emby.Server.Implementations/SyncPlay/GroupController.cs @@ -188,19 +188,6 @@ namespace Emby.Server.Implementations.SyncPlay }; } - /// - /// Checks if a given user can access a given item, that is, the user has access to a folder where the item is stored. - /// - /// The user. - /// The item. - /// true if the user can access the item, false otherwise. - private bool HasAccessToItem(User user, BaseItem item) - { - var collections = _libraryManager.GetCollectionFolders(item) - .Select(folder => folder.Id.ToString("N", CultureInfo.InvariantCulture)); - return collections.Intersect(user.GetPreference(PreferenceKind.EnabledFolders)).Any(); - } - /// /// Checks if a given user can access all items of a given queue, that is, /// the user has the required minimum parental access and has access to all required folders. @@ -219,12 +206,7 @@ namespace Emby.Server.Implementations.SyncPlay foreach (var itemId in queue) { var item = _libraryManager.GetItemById(itemId); - if (user.MaxParentalAgeRating.HasValue && item.InheritedParentalRatingValue > user.MaxParentalAgeRating) - { - return false; - } - - if (!user.HasPermission(PermissionKind.EnableAllFolders) && !HasAccessToItem(user, item)) + if (!item.IsVisibleStandalone(user)) { return false; } -- cgit v1.2.3