mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-03-11 17:57:49 +01:00
* Users list: Cleanups * Policies: Flip registration settings * Policies: Add RequireUserApproval setting * Add approval to user * Require approval on login and for API key * API handling * AccountController cleanups * Test fix * Apply suggestions from code review Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com> * Add missing imports * Communicate login requirements to user on account creation * Add login requirements to basic auth handler * Cleanups and test fix * Encapsulate approval logic in user service and log approval changes * Send follow up "Account approved" email Closes #5656. * Add notification for admins * Fix creating a user via the admin view * Update list: Unify flags into status column, add approve action * Adjust "Resend email" wording * Incorporate feedback from code review * Remove duplicate test server policy reset --------- Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com>
32 lines
1.2 KiB
C#
32 lines
1.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using BTCPayServer.Services.Stores;
|
|
|
|
namespace BTCPayServer.Models.ServerViewModels
|
|
{
|
|
public class UsersViewModel : BasePagingViewModel
|
|
{
|
|
public class UserViewModel
|
|
{
|
|
public string Id { get; set; }
|
|
public string Name { get; set; }
|
|
public string Email { get; set; }
|
|
public bool? EmailConfirmed { get; set; }
|
|
public bool? Approved { get; set; }
|
|
public bool Disabled { get; set; }
|
|
public bool IsAdmin { get; set; }
|
|
public DateTimeOffset? Created { get; set; }
|
|
public IEnumerable<string> Roles { get; set; }
|
|
}
|
|
public List<UserViewModel> Users { get; set; } = new List<UserViewModel>();
|
|
public override int CurrentPageCount => Users.Count;
|
|
public Dictionary<string, string> Roles { get; set; }
|
|
}
|
|
public class RolesViewModel : BasePagingViewModel
|
|
{
|
|
public List<StoreRepository.StoreRole> Roles { get; set; } = new List<StoreRepository.StoreRole>();
|
|
public string DefaultRole { get; set; }
|
|
public override int CurrentPageCount => Roles.Count;
|
|
}
|
|
|
|
}
|