mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-14 02:26:55 -07:00
All Sln changes
This commit is contained in:
parent
b5855f2644
commit
796f0fc188
615 changed files with 68 additions and 747 deletions
35
Ombi.Core/ISecurityExtensions.cs
Normal file
35
Ombi.Core/ISecurityExtensions.cs
Normal file
|
@ -0,0 +1,35 @@
|
|||
using System;
|
||||
using Nancy;
|
||||
using Nancy.Security;
|
||||
using Nancy.Session;
|
||||
using Ombi.Helpers.Permissions;
|
||||
|
||||
namespace Ombi.Core
|
||||
{
|
||||
public interface ISecurityExtensions
|
||||
{
|
||||
Response AdminLoginRedirect(Permissions perm, NancyContext context);
|
||||
Response AdminLoginRedirect(NancyContext context, params Permissions[] perm);
|
||||
bool DoesNotHavePermissions(Permissions perm, IUserIdentity currentUser);
|
||||
|
||||
Response HasAnyPermissionsRedirect(NancyContext context, string routeName, HttpStatusCode code,
|
||||
params Permissions[] perm);
|
||||
bool DoesNotHavePermissions(int perm, IUserIdentity currentUser);
|
||||
Func<NancyContext, Response> ForbiddenIfNot(Func<NancyContext, bool> test);
|
||||
bool HasAnyPermissions(IUserIdentity user, params Permissions[] perm);
|
||||
bool HasPermissions(IUserIdentity user, Permissions perm);
|
||||
Response HasPermissionsRedirect(Permissions perm, NancyContext context, string routeName, HttpStatusCode code);
|
||||
Func<NancyContext, Response> HttpStatusCodeIfNot(HttpStatusCode statusCode, Func<NancyContext, bool> test);
|
||||
bool IsLoggedIn(NancyContext context);
|
||||
bool IsNormalUser(IUserIdentity user);
|
||||
bool IsPlexUser(IUserIdentity user);
|
||||
bool HasPermissions(string userName, Permissions perm);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the username this could be the alias! We should always use this method when getting the username
|
||||
/// </summary>
|
||||
/// <param name="username">The username.</param>
|
||||
/// <returns><c>null</c> if we cannot find a user</returns>
|
||||
string GetUsername(string username, ISession session);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue