diff --git a/Jellyfin.Api/Controllers/UserController.cs b/Jellyfin.Api/Controllers/UserController.cs index 0c70517531..82c8563a80 100644 --- a/Jellyfin.Api/Controllers/UserController.cs +++ b/Jellyfin.Api/Controllers/UserController.cs @@ -256,7 +256,7 @@ namespace Jellyfin.Api.Controllers /// User not found. /// A indicating success or a or a on failure. [HttpPost("{userId}/Password")] - [Authorize(Policy = Policies.IgnoreParentalControl)] + [Authorize(Policy = Policies.DefaultAuthorization)] [ProducesResponseType(StatusCodes.Status204NoContent)] [ProducesResponseType(StatusCodes.Status403Forbidden)] [ProducesResponseType(StatusCodes.Status404NotFound)] @@ -282,15 +282,14 @@ namespace Jellyfin.Api.Controllers } else { - if (HttpContext.User.IsInRole(UserRoles.Administrator)) + if (!HttpContext.User.IsInRole(UserRoles.Administrator)) { var success = await _userManager.AuthenticateUser( user.Username, request.CurrentPw, request.CurrentPw, HttpContext.GetNormalizedRemoteIp().ToString(), - false, - ignoreParentalSchedule: true).ConfigureAwait(false); + false).ConfigureAwait(false); if (success == null) { diff --git a/Jellyfin.Server.Implementations/Users/UserManager.cs b/Jellyfin.Server.Implementations/Users/UserManager.cs index 09ee7fc6e6..2100fa6d59 100644 --- a/Jellyfin.Server.Implementations/Users/UserManager.cs +++ b/Jellyfin.Server.Implementations/Users/UserManager.cs @@ -382,8 +382,7 @@ namespace Jellyfin.Server.Implementations.Users string password, string passwordSha1, string remoteEndPoint, - bool isUserSession, - bool ignoreParentalSchedule = false) + bool isUserSession) { if (string.IsNullOrWhiteSpace(username)) { @@ -459,7 +458,7 @@ namespace Jellyfin.Server.Implementations.Users throw new SecurityException("Forbidden."); } - if (!ignoreParentalSchedule && !user.IsParentalScheduleAllowed()) + if (!user.IsParentalScheduleAllowed()) { _logger.LogInformation( "Authentication request for {UserName} is not allowed at this time due parental restrictions (IP: {IP}).", diff --git a/MediaBrowser.Controller/Library/IUserManager.cs b/MediaBrowser.Controller/Library/IUserManager.cs index 7884362635..993e3e18f9 100644 --- a/MediaBrowser.Controller/Library/IUserManager.cs +++ b/MediaBrowser.Controller/Library/IUserManager.cs @@ -138,9 +138,8 @@ namespace MediaBrowser.Controller.Library /// Hash of password. /// Remove endpoint to use. /// Specifies if a user session. - /// Ignore parental control schedule during authentication. /// User wrapped in awaitable task. - Task AuthenticateUser(string username, string password, string passwordSha1, string remoteEndPoint, bool isUserSession, bool ignoreParentalSchedule = false); + Task AuthenticateUser(string username, string password, string passwordSha1, string remoteEndPoint, bool isUserSession); /// /// Starts the forgot password process.