Updated the claims so we can support more users.

Added a user management section (not yet complete)
Added the api to the solution and a api key in the settings (currently only gets the requests).
This commit is contained in:
TidusJar 2016-05-15 21:51:20 -04:00
parent 741a4ae75c
commit 98eadc9cc6
12 changed files with 217 additions and 1 deletions

View file

@ -0,0 +1,39 @@
using System;
using Nancy;
using Nancy.Authentication.Forms;
using Nancy.Extensions;
using Nancy.Responses.Negotiation;
using Nancy.Security;
using PlexRequests.Core;
using PlexRequests.UI.Models;
using PlexRequests.UI.Modules;
using PlexRequests.Helpers;
namespace PlexRequests.UI
{
public class UserManagementModule : BaseModule
{
public UserManagementModule () : base("usermanagement")
{
this.RequiresClaims (UserClaims.Admin);
Get["/"] = x => Load();
Get ["/users"] = x => LoadUsers ();
}
public Negotiator Load()
{
return View ["Index"];
}
public Response LoadUsers()
{
var users = UserMapper.GetUsers ();
return Response.AsJson (users);
}
}
}