#195 logging bad behaviour api
This commit is contained in:
parent
3f09895234
commit
dd3fc288db
@ -1127,6 +1127,25 @@ namespace RSecurityBackend.Controllers
|
||||
return Ok(result.Result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// get user behaviour logs
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
[Authorize(Policy = SecurableItem.UserEntityShortName + ":" + SecurableItem.Administer)]
|
||||
[Route("behaviour/log/{userId}")]
|
||||
[ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(RUserBehaviourLog[]))]
|
||||
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(string))]
|
||||
[ProducesResponseType((int)HttpStatusCode.NotFound)]
|
||||
public async Task<IActionResult> GetUserBehaviourLogsAsync(Guid userId)
|
||||
{
|
||||
RServiceResult<RUserBehaviourLog[]> result = await _appUserService.GetUserBehaviourLogsAsync(userId);
|
||||
if (!string.IsNullOrEmpty(result.ExceptionString))
|
||||
return BadRequest(result.ExceptionString);
|
||||
return Ok(result.Result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// kick out a user
|
||||
/// </summary>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user