mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 23:52:50 -05:00
Org admin cleanup
- Added sproc to check if org admin for free org create - Removed old proeprties not in user from org and subvault - Added more cascade deletes
This commit is contained in:
@ -44,14 +44,12 @@ namespace Bit.Core.Models.Api
|
||||
{
|
||||
[Required]
|
||||
public string SubvaultId { get; set; }
|
||||
public bool Admin { get; set; }
|
||||
public bool ReadOnly { get; set; }
|
||||
|
||||
public SubvaultUser ToSubvaultUser()
|
||||
{
|
||||
var subvault = new SubvaultUser
|
||||
{
|
||||
Admin = Admin,
|
||||
ReadOnly = ReadOnly,
|
||||
SubvaultId = new Guid(SubvaultId)
|
||||
};
|
||||
|
@ -1,9 +1,5 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Bit.Core.Utilities;
|
||||
using Bit.Core.Models.Table;
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
@ -20,7 +16,6 @@ namespace Bit.Core.Models.Api
|
||||
{
|
||||
OrganizationUserId = new Guid(UserId),
|
||||
SubvaultId = new Guid(s.SubvaultId),
|
||||
Admin = s.Admin,
|
||||
ReadOnly = s.ReadOnly
|
||||
});
|
||||
}
|
||||
@ -28,7 +23,6 @@ namespace Bit.Core.Models.Api
|
||||
public class Subvault
|
||||
{
|
||||
public string SubvaultId { get; set; }
|
||||
public bool Admin { get; set; }
|
||||
public bool ReadOnly { get; set; }
|
||||
}
|
||||
}
|
||||
@ -36,7 +30,6 @@ namespace Bit.Core.Models.Api
|
||||
public class SubvaultUserUserRequestModel
|
||||
{
|
||||
public string UserId { get; set; }
|
||||
public bool Admin { get; set; }
|
||||
public bool ReadOnly { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -23,7 +23,6 @@ namespace Bit.Core.Models.Api
|
||||
BillingEmail = organization.BillingEmail;
|
||||
Plan = organization.Plan;
|
||||
PlanType = organization.PlanType;
|
||||
PlanTrial = organization.PlanTrial;
|
||||
MaxUsers = organization.MaxUsers;
|
||||
}
|
||||
|
||||
@ -33,7 +32,6 @@ namespace Bit.Core.Models.Api
|
||||
public string BillingEmail { get; set; }
|
||||
public string Plan { get; set; }
|
||||
public Enums.PlanType PlanType { get; set; }
|
||||
public bool PlanTrial { get; set; }
|
||||
public short MaxUsers { get; set; }
|
||||
}
|
||||
|
||||
|
@ -18,13 +18,11 @@ namespace Bit.Core.Models.Api
|
||||
Name = details.Name;
|
||||
SubvaultId = details.SubvaultId.ToString();
|
||||
ReadOnly = details.ReadOnly;
|
||||
Admin = details.Admin;
|
||||
}
|
||||
|
||||
public string Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string SubvaultId { get; set; }
|
||||
public bool ReadOnly { get; set; }
|
||||
public bool Admin { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -23,7 +23,6 @@ namespace Bit.Core.Models.Api
|
||||
Type = subvaultUser.Type;
|
||||
Status = subvaultUser.Status;
|
||||
ReadOnly = subvaultUser.ReadOnly;
|
||||
Admin = subvaultUser.Admin;
|
||||
}
|
||||
|
||||
public string Id { get; set; }
|
||||
@ -34,6 +33,5 @@ namespace Bit.Core.Models.Api
|
||||
public OrganizationUserType Type { get; set; }
|
||||
public OrganizationUserStatusType Status { get; set; }
|
||||
public bool ReadOnly { get; set; }
|
||||
public bool Admin { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -6,6 +6,5 @@ namespace Bit.Core.Models.Data
|
||||
{
|
||||
public Guid SubvaultId { get; set; }
|
||||
public bool ReadOnly { get; set; }
|
||||
public bool Admin { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -9,6 +9,5 @@ namespace Bit.Core.Models.Data
|
||||
public string Name { get; set; }
|
||||
public Guid SubvaultId { get; set; }
|
||||
public bool ReadOnly { get; set; }
|
||||
public bool Admin { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,5 @@ namespace Bit.Core.Models.Data
|
||||
public Enums.OrganizationUserStatusType Status { get; set; }
|
||||
public Enums.OrganizationUserType Type { get; set; }
|
||||
public bool ReadOnly { get; set; }
|
||||
public bool Admin { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -13,12 +13,6 @@ namespace Bit.Core.Models.Table
|
||||
public string BillingEmail { get; set; }
|
||||
public string Plan { get; set; }
|
||||
public PlanType PlanType { get; set; }
|
||||
public decimal PlanBasePrice { get; set; }
|
||||
public decimal PlanUserPrice { get; set; }
|
||||
public DateTime? PlanRenewalDate { get; set; }
|
||||
public bool PlanTrial { get; set; }
|
||||
public short BaseUsers { get; set; }
|
||||
public short AdditionalUsers { get; set; }
|
||||
public short MaxUsers { get; set; }
|
||||
public string StripeCustomerId { get; set; }
|
||||
public string StripeSubscriptionId { get; set; }
|
||||
|
@ -8,7 +8,6 @@ namespace Bit.Core.Models.Table
|
||||
public Guid Id { get; set; }
|
||||
public Guid SubvaultId { get; set; }
|
||||
public Guid OrganizationUserId { get; set; }
|
||||
public bool Admin { get; set; }
|
||||
public bool ReadOnly { get; set; }
|
||||
public DateTime CreationDate { get; internal set; } = DateTime.UtcNow;
|
||||
public DateTime RevisionDate { get; internal set; } = DateTime.UtcNow;
|
||||
|
Reference in New Issue
Block a user