You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Ombi/PlexRequests.UI/Modules/UserManagementModule.cs

40 lines
699 B

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);
}
}
}