Audit Service
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using FoodsharingSiegen.Contracts;
|
||||
using FoodsharingSiegen.Contracts.Entity;
|
||||
using FoodsharingSiegen.Server.Auth;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace FoodsharingSiegen.Server.Data.Service
|
||||
@@ -16,10 +17,8 @@ namespace FoodsharingSiegen.Server.Data.Service
|
||||
/// Initializes a new instance of the <see cref="UserService"/> class
|
||||
/// </summary>
|
||||
/// <param name="context">The context</param>
|
||||
public UserService(FsContext context) : base(context)
|
||||
{
|
||||
|
||||
}
|
||||
/// <param name="authService"></param>
|
||||
public UserService(FsContext context, AuthService authService) : base(context, authService) { }
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -58,28 +57,6 @@ namespace FoodsharingSiegen.Server.Data.Service
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Method CheckForceLogout
|
||||
|
||||
/// <summary>
|
||||
/// Checks the force logout using the specified user (a. beging, 11.04.2022)
|
||||
/// </summary>
|
||||
/// <param name="user">The user</param>
|
||||
/// <returns>A task containing an operation result of bool</returns>
|
||||
public async Task<OperationResult<bool>> CheckForceLogout(User user)
|
||||
{
|
||||
try
|
||||
{
|
||||
var anyR = await Context.Users.AnyAsync(x => x.Id == user.Id && x.ForceLogout);
|
||||
return new OperationResult<bool>(anyR);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return new OperationResult<bool>(e);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Method GetUsersAsync
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user