mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-08 06:00:50 -07:00
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:
parent
741a4ae75c
commit
98eadc9cc6
12 changed files with 217 additions and 1 deletions
39
PlexRequests.UI/Modules/UserManagementModule.cs
Normal file
39
PlexRequests.UI/Modules/UserManagementModule.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue