1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 15:20:48 -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

@ -10,6 +10,7 @@ using SharedLibraryCore;
using SharedLibraryCore.Commands;
using SharedLibraryCore.Configuration;
using SharedLibraryCore.Interfaces;
using WebfrontCore.Permissions;
using WebfrontCore.ViewModels;
namespace WebfrontCore.Controllers
@ -314,6 +315,14 @@ namespace WebfrontCore.Controllers
public async Task<IActionResult> RecentClientsForm()
{
var clients = await Manager.GetClientService().GetRecentClients();
foreach (var client in clients)
{
client.IPAddress =
_appConfig.HasPermission(Client.Level, WebfrontEntity.IPAddress, WebfrontPermission.Read)
? client.IPAddress
: null;
}
return View("~/Views/Shared/Components/Client/_RecentClients.cshtml", clients);
}
@ -453,4 +462,4 @@ namespace WebfrontCore.Controllers
})
.ToDictionary(item => item.Value, item => item.Value);
}
}
}