Set the admin to have all claims

This commit is contained in:
tidusjar 2016-05-26 17:31:01 +01:00
parent a679f1a6a1
commit 16bd4f5b71
4 changed files with 87 additions and 20 deletions

View file

@ -46,24 +46,24 @@ namespace PlexRequests.UI.Modules
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});
}
//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"});
}
// return Response.AsJson(new JsonResponseModel {Result = false, Message = "Could not save user"});
//}
}
}