btcpayserver/BTCPayServer/Models/ServerViewModels/UsersViewModel.cs
d11n d55770cc16
Admin overview of the stores on the instance (#5745)
* Admin overview of the stores on the instance

POC/Draft for #5674.

* Enable admin to access foreign stores

* Remove stores list link

* UI updates

* Grant admins guest access to foreign stores

* Optimize cookie auth handler

* Test fix

* Revert changes related to StoreRepository.FindStore with isAdmin
2024-02-23 09:51:41 +01:00

34 lines
1.3 KiB
C#

using System;
using System.Collections.Generic;
using BTCPayServer.Data;
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 IEnumerable<UserStore> Stores { 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;
}
}