1
0
mirror of https://github.com/bitwarden/server synced 2025-12-24 20:23:21 +00:00

[PM-21097] Fix: Prevent admin-added sponsored families from appearing in individual vault settings (#5767)

* Changes to resolve sponsorship showing in individual vault

* Resolve the failing unit test

Signed-off-by: Cy Okeke <cokeke@bitwarden.com>

* Resolve the failing test

* Resolve the failing test

* Resolve the failing test

* fix make IsAdminInitiated nullable

Signed-off-by: Cy Okeke <cokeke@bitwarden.com>

* Add the isAdminInitiated property

Signed-off-by: Cy Okeke <cokeke@bitwarden.com>

* Resolve the database error

Signed-off-by: Cy Okeke <cokeke@bitwarden.com>

* Resolve the failing unit test

Signed-off-by: Cy Okeke <cokeke@bitwarden.com>

* Resolve the scan error

Signed-off-by: Cy Okeke <cokeke@bitwarden.com>

* Resolve the database issue

* resolve the database build error

* Resolve the database build error

* Resolve the synchronization issue

---------

Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
This commit is contained in:
cyprain-okeke
2025-05-12 18:21:07 +01:00
committed by GitHub
parent 3a848d5747
commit e4359f071c
11 changed files with 294 additions and 12 deletions

View File

@@ -7,8 +7,7 @@ public class OrganizationUserOrganizationDetailsViewQuery : IQuery<OrganizationU
public IQueryable<OrganizationUserOrganizationDetails> Run(DatabaseContext dbContext)
{
var query = from ou in dbContext.OrganizationUsers
join o in dbContext.Organizations on ou.OrganizationId equals o.Id into outerOrganization
from o in outerOrganization.DefaultIfEmpty()
join o in dbContext.Organizations on ou.OrganizationId equals o.Id
join su in dbContext.SsoUsers on new { ou.UserId, OrganizationId = (Guid?)ou.OrganizationId } equals new { UserId = (Guid?)su.UserId, su.OrganizationId } into su_g
from su in su_g.DefaultIfEmpty()
join po in dbContext.ProviderOrganizations on o.Id equals po.OrganizationId into po_g
@@ -68,10 +67,11 @@ public class OrganizationUserOrganizationDetailsViewQuery : IQuery<OrganizationU
SmServiceAccounts = o.SmServiceAccounts,
LimitCollectionCreation = o.LimitCollectionCreation,
LimitCollectionDeletion = o.LimitCollectionDeletion,
LimitItemDeletion = o.LimitItemDeletion,
AllowAdminAccessToAllCollectionItems = o.AllowAdminAccessToAllCollectionItems,
UseRiskInsights = o.UseRiskInsights,
UseAdminSponsoredFamilies = o.UseAdminSponsoredFamilies,
LimitItemDeletion = o.LimitItemDeletion,
IsAdminInitiated = os.IsAdminInitiated
};
return query;
}