feat(api): управление ролями пользователя
This commit is contained in:
@@ -85,6 +85,19 @@ namespace PARR.API.Services.Implementations
|
||||
}
|
||||
|
||||
|
||||
public async Task UnlockUserAsync(string ipAddress)
|
||||
{
|
||||
await cacheService.DeleteCachedDataAsync(GetBlockKey(ipAddress));
|
||||
}
|
||||
|
||||
|
||||
public async Task RemoveCacheUserAsync(string ipAddress)
|
||||
{
|
||||
await cacheService.DeleteCachedDataAsync(GetAllowKey(ipAddress));
|
||||
await cacheService.DeleteCachedDataAsync(GetBlockKey(ipAddress));
|
||||
}
|
||||
|
||||
|
||||
private string GetBlockKey(string ipAddress)
|
||||
{
|
||||
// d - deny
|
||||
|
||||
@@ -18,5 +18,19 @@ namespace PARR.API.Services.Interfaces
|
||||
/// <param name="ipAddress"></param>
|
||||
/// <returns></returns>
|
||||
Task<bool> UserIsBlockedAsync(string ipAddress);
|
||||
|
||||
/// <summary>
|
||||
/// Удалить из кэша пользователя
|
||||
/// </summary>
|
||||
/// <param name="ipAddress"></param>
|
||||
/// <returns></returns>
|
||||
Task RemoveCacheUserAsync(string ipAddress);
|
||||
|
||||
/// <summary>
|
||||
/// Разблокировать пользователя
|
||||
/// </summary>
|
||||
/// <param name="ipAddress"></param>
|
||||
/// <returns></returns>
|
||||
Task UnlockUserAsync(string ipAddress);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user