mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-07 21:51:13 -07:00
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).
39 lines
699 B
C#
39 lines
699 B
C#
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);
|
|
}
|
|
}
|
|
}
|
|
|