mirror of
https://github.com/bitwarden/server
synced 2025-12-10 13:23:27 +00:00
* [EC-343] Added column 'UseCustomPermissions' to Organization table
* [EC-343] Added 'UseCustomPermissions' to Api responses
* [EC-343] Added 'UseCustomPermissions' to Admin view
* [EC-343] Add constraint to Organization table to have default UseCustomPermissions value
* [EC-343] Recreate OrganizationView to include UseCustomPermissions column
* [EC-343] Add MySql EF migrations
* [EC-343] Add Postgres EF migrations
* Revert "[EC-343] Add Postgres EF migrations"
This reverts commit 8f1654cb7d.
* [EC-343] Add Postgres migrations and script
* [EC-343] dotnet format
* [EC-343] Set 'Custom Permissions' feature as unchecked for teams plan
* [EC-343] Add CustomPermissions to plan upgrades
* [EC-343] Update CURRENT_LICENSE_FILE_VERSION
* [EC-343] Enable 'Custom Permissions' on Enterprise 2019 plan
* [EC-343] Updated migration script to include Enterprise 2019 plan
* [EC-343] Update CURRENT_LICENSE_FILE_VERSION to 10
* [EC-343] Move logic checking if Organization can use custom permissions to OrganizationService
* [EC-343] Add unit tests to validate UseCustomPermissions check
* [EC-343] Revert UseCustomPermissionsFlag migration
* [EC-343] Fix typo in OrganizationUserOrganizationDetailsViewQuery
* [EC-343] Add Postgres migrations without affecting other datetime column
* [EC-343] Create ValidateOrganizationCustomPermissionsEnabledAsync. Add more unit tests around CustomPermissions check
* [EC-343] Add curly brackets to if condition
* [EC-343] Rename unit tests
47 lines
1.8 KiB
C#
47 lines
1.8 KiB
C#
using Bit.Core.Models.Data;
|
|
|
|
namespace Bit.Infrastructure.EntityFramework.Repositories.Queries;
|
|
|
|
public class ProviderUserOrganizationDetailsViewQuery : IQuery<ProviderUserOrganizationDetails>
|
|
{
|
|
public IQueryable<ProviderUserOrganizationDetails> Run(DatabaseContext dbContext)
|
|
{
|
|
var query = from pu in dbContext.ProviderUsers
|
|
join po in dbContext.ProviderOrganizations on pu.ProviderId equals po.ProviderId
|
|
join o in dbContext.Organizations on po.OrganizationId equals o.Id
|
|
join p in dbContext.Providers on pu.ProviderId equals p.Id
|
|
select new { pu, po, o, p };
|
|
return query.Select(x => new ProviderUserOrganizationDetails
|
|
{
|
|
OrganizationId = x.po.OrganizationId,
|
|
UserId = x.pu.UserId,
|
|
Name = x.o.Name,
|
|
Enabled = x.o.Enabled,
|
|
UsePolicies = x.o.UsePolicies,
|
|
UseSso = x.o.UseSso,
|
|
UseKeyConnector = x.o.UseKeyConnector,
|
|
UseScim = x.o.UseScim,
|
|
UseGroups = x.o.UseGroups,
|
|
UseDirectory = x.o.UseDirectory,
|
|
UseEvents = x.o.UseEvents,
|
|
UseTotp = x.o.UseTotp,
|
|
Use2fa = x.o.Use2fa,
|
|
UseApi = x.o.UseApi,
|
|
SelfHost = x.o.SelfHost,
|
|
UsersGetPremium = x.o.UsersGetPremium,
|
|
UseCustomPermissions = x.o.UseCustomPermissions,
|
|
Seats = x.o.Seats,
|
|
MaxCollections = x.o.MaxCollections,
|
|
MaxStorageGb = x.o.MaxStorageGb,
|
|
Identifier = x.o.Identifier,
|
|
Key = x.po.Key,
|
|
Status = x.pu.Status,
|
|
Type = x.pu.Type,
|
|
PublicKey = x.o.PublicKey,
|
|
PrivateKey = x.o.PrivateKey,
|
|
ProviderId = x.p.Id,
|
|
ProviderName = x.p.Name,
|
|
});
|
|
}
|
|
}
|