1
0
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:
RaidMax
2022-04-04 22:16:40 -05:00
parent bab39955c8
commit 91a05348f0
8 changed files with 125 additions and 41 deletions

View File

@ -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);
}
}
}
}