1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-30 15:42:48 -05:00

[AC-2286] Include the OrganizationUserId for each Organization in the user sync data (#4142)

* [AC-2286] Include the OrganizationUserId for each Organization in the user sync data

* Make OrganizationUserId property non-nullable
This commit is contained in:
Rui Tomé
2024-06-07 19:32:09 +01:00
committed by GitHub
parent 36705790ad
commit 308bd555a4
6 changed files with 164 additions and 0 deletions

View File

@ -48,6 +48,7 @@ public class ProfileOrganizationResponseModel : ResponseModel
Permissions = CoreHelpers.LoadClassFromJsonData<Permissions>(organization.Permissions);
ResetPasswordEnrolled = organization.ResetPasswordKey != null;
UserId = organization.UserId;
OrganizationUserId = organization.OrganizationUserId;
ProviderId = organization.ProviderId;
ProviderName = organization.ProviderName;
ProviderType = organization.ProviderType;
@ -138,6 +139,7 @@ public class ProfileOrganizationResponseModel : ResponseModel
public Permissions Permissions { get; set; }
public bool ResetPasswordEnrolled { get; set; }
public Guid? UserId { get; set; }
public Guid OrganizationUserId { get; set; }
public bool HasPublicAndPrivateKeys { get; set; }
public Guid? ProviderId { get; set; }
[JsonConverter(typeof(HtmlEncodingStringConverter))]

View File

@ -8,6 +8,7 @@ public class OrganizationUserOrganizationDetails
{
public Guid OrganizationId { get; set; }
public Guid? UserId { get; set; }
public Guid OrganizationUserId { get; set; }
[JsonConverter(typeof(HtmlEncodingStringConverter))]
public string Name { get; set; }
public bool UsePolicies { get; set; }

View File

@ -23,6 +23,7 @@ public class OrganizationUserOrganizationDetailsViewQuery : IQuery<OrganizationU
{
UserId = ou.UserId,
OrganizationId = ou.OrganizationId,
OrganizationUserId = ou.Id,
Name = o.Name,
Enabled = o.Enabled,
PlanType = o.PlanType,

View File

@ -3,6 +3,7 @@ AS
SELECT
OU.[UserId],
OU.[OrganizationId],
OU.[Id] OrganizationUserId,
O.[Name],
O.[Enabled],
O.[PlanType],