mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-13 00:28:10 -05:00
initial permissions based webfront access implementation
This commit is contained in:
@ -30,6 +30,7 @@ namespace SharedLibraryCore
|
||||
private static string SocialTitle;
|
||||
protected readonly DatabaseContext Context;
|
||||
protected List<Page> Pages;
|
||||
protected List<string> PermissionsSet;
|
||||
|
||||
public BaseController(IManager manager)
|
||||
{
|
||||
@ -43,7 +44,6 @@ namespace SharedLibraryCore
|
||||
SocialTitle = AppConfig.SocialLinkTitle;
|
||||
}
|
||||
|
||||
|
||||
Pages = Manager.GetPageList().Pages
|
||||
.Select(page => new Page
|
||||
{
|
||||
@ -135,6 +135,11 @@ namespace SharedLibraryCore
|
||||
var claimsIdentity = new ClaimsIdentity(claims, "login");
|
||||
SignInAsync(new ClaimsPrincipal(claimsIdentity)).Wait();
|
||||
}
|
||||
|
||||
if (AppConfig.PermissionSets.ContainsKey(Client.Level.ToString()))
|
||||
{
|
||||
PermissionsSet = AppConfig.PermissionSets[Client.Level.ToString()];
|
||||
}
|
||||
|
||||
var communityName = AppConfig.CommunityInformation?.Name;
|
||||
var shouldUseCommunityName = !string.IsNullOrWhiteSpace(communityName)
|
||||
@ -160,4 +165,4 @@ namespace SharedLibraryCore
|
||||
base.OnActionExecuting(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user