diff --git a/PlexRequests.UI/Modules/ApprovalModule.cs b/PlexRequests.UI/Modules/ApprovalModule.cs index d74431eb8..d57f31a1f 100644 --- a/PlexRequests.UI/Modules/ApprovalModule.cs +++ b/PlexRequests.UI/Modules/ApprovalModule.cs @@ -276,11 +276,6 @@ namespace PlexRequests.UI.Modules private Response ApproveAllTVShows() { - if (!Context.CurrentUser.IsAuthenticated()) - { - return Response.AsJson(new JsonResponseModel { Result = false, Message = "You are not an Admin, so you cannot approve any requests." }); - } - var requests = Service.GetAll().Where(x => x.CanApprove && x.Type == RequestType.TvShow); var requestedModels = requests as RequestedModel[] ?? requests.ToArray(); if (!requestedModels.Any()) diff --git a/PlexRequests.UI/Modules/UserManagementModule.cs b/PlexRequests.UI/Modules/UserManagementModule.cs index eeed0db69..d0eff824d 100644 --- a/PlexRequests.UI/Modules/UserManagementModule.cs +++ b/PlexRequests.UI/Modules/UserManagementModule.cs @@ -25,12 +25,12 @@ namespace PlexRequests.UI Get ["/users"] = x => LoadUsers (); } - public Negotiator Load() + private Negotiator Load() { return View ["Index"]; } - public Response LoadUsers() + private Response LoadUsers() { var users = UserMapper.GetUsers (); var model = new List(); @@ -45,6 +45,21 @@ namespace PlexRequests.UI } return Response.AsJson (users); } - } + + private Response CreateUser(string username, string password, string claims) + { + if (string.IsNullOrWhiteSpace (username) || string.IsNullOrWhiteSpace (password)) { + return Response.AsJson (new JsonResponseModel { + Result = true, + Message = "Please enter in a valid Username and Password" + }); + } + var user = UserMapper.CreateUser (username, password, new string[]{ claims }); + if(user.HasValue){ + return Response.AsJson(new JsonResponseModel{ Result = true}); + } + + return Response.AsJson(new JsonResponseModel{ Result = false, Message = "Could not save user"}); + } }