Fixed an IOC issue

pull/733/head
tidusjar 8 years ago
parent 2a8927eb6d
commit df0dbde73c

@ -37,19 +37,16 @@ namespace PlexRequests.UI.Helpers
{
public static class HtmlSecurityHelper
{
private static SecurityExtensions Security
private static ISecurityExtensions Security
{
get
{
var userRepo = ServiceLocator.Instance.Resolve<IUserRepository>();
var linker = ServiceLocator.Instance.Resolve<IResourceLinker>();
var plex = ServiceLocator.Instance.Resolve<IPlexUserRepository>();
return _security ?? (_security = new SecurityExtensions(userRepo, null, linker, plex));
var security = ServiceLocator.Instance.Resolve<ISecurityExtensions>();
return _security ?? (_security = security);
}
}
private static SecurityExtensions _security;
private static ISecurityExtensions _security;
public static bool HasAnyPermission(this HtmlHelpers helper, int permission, bool authenticated = true)

@ -38,16 +38,14 @@ namespace PlexRequests.UI.Helpers
{
public class SecurityExtensions : ISecurityExtensions
{
public SecurityExtensions(IUserRepository userRepository, NancyModule context, IResourceLinker linker, IPlexUserRepository plexUsers)
public SecurityExtensions(IUserRepository userRepository, IResourceLinker linker, IPlexUserRepository plexUsers)
{
UserRepository = userRepository;
Module = context;
Linker = linker;
PlexUsers = plexUsers;
}
private IUserRepository UserRepository { get; }
private NancyModule Module { get; }
private IResourceLinker Linker { get; }
private IPlexUserRepository PlexUsers { get; }

Loading…
Cancel
Save