mirror of
https://github.com/bitwarden/server
synced 2025-12-25 12:43:14 +00:00
user/org view pages
This commit is contained in:
27
src/Admin/Models/OrganizationViewModel.cs
Normal file
27
src/Admin/Models/OrganizationViewModel.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Bit.Core.Enums;
|
||||
using Bit.Core.Models.Data;
|
||||
using Bit.Core.Models.Table;
|
||||
|
||||
namespace Bit.Admin.Models
|
||||
{
|
||||
public class OrganizationViewModel
|
||||
{
|
||||
public OrganizationViewModel() { }
|
||||
|
||||
public OrganizationViewModel(Organization org, IEnumerable<OrganizationUserUserDetails> orgUsers)
|
||||
{
|
||||
Organization = org;
|
||||
UserCount = orgUsers.Count();
|
||||
Owners = string.Join(", ", orgUsers.Where(u => u.Type == OrganizationUserType.Owner).Select(u => u.Email));
|
||||
Admins = string.Join(", ", orgUsers.Where(u => u.Type == OrganizationUserType.Admin).Select(u => u.Email));
|
||||
}
|
||||
|
||||
public Organization Organization { get; set; }
|
||||
public string Owners { get; set; }
|
||||
public string Admins { get; set; }
|
||||
public int UserCount { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user