Selaa lähdekoodia

fixes #2903 - MediaBrowser.Controller.Net.SecurityException: This user account is not allowed access at this time

Luke Pulverenti 7 vuotta sitten
vanhempi
sitoutus
8d4373af5e
1 muutettua tiedostoa jossa 11 lisäystä ja 3 poistoa
  1. 11 3
      Emby.Server.Implementations/Session/SessionManager.cs

+ 11 - 3
Emby.Server.Implementations/Session/SessionManager.cs

@@ -1406,11 +1406,19 @@ namespace Emby.Server.Implementations.Session
                     .FirstOrDefault(i => string.Equals(request.Username, i.Name, StringComparison.OrdinalIgnoreCase));
                     .FirstOrDefault(i => string.Equals(request.Username, i.Name, StringComparison.OrdinalIgnoreCase));
             }
             }
 
 
-            if (user != null && !string.IsNullOrWhiteSpace(request.DeviceId))
+            if (user != null)
             {
             {
-                if (!_deviceManager.CanAccessDevice(user.Id.ToString("N"), request.DeviceId))
+                if (!user.IsParentalScheduleAllowed())
+                {
+                    throw new SecurityException("User is not allowed access at this time.");
+                }
+
+                if (!string.IsNullOrWhiteSpace(request.DeviceId))
                 {
                 {
-                    throw new SecurityException("User is not allowed access from this device.");
+                    if (!_deviceManager.CanAccessDevice(user.Id.ToString("N"), request.DeviceId))
+                    {
+                        throw new SecurityException("User is not allowed access from this device.");
+                    }
                 }
                 }
             }
             }