mirror of
https://github.com/bitwarden/server.git
synced 2026-02-01 22:53:12 +08:00
* Revert "Add git blame entry (#2226)" This reverts commit239286737d. * Revert "Turn on file scoped namespaces (#2225)" This reverts commit34fb4cca2a.
30 lines
1.1 KiB
C#
30 lines
1.1 KiB
C#
using Bit.Core.Enums;
|
|
using Bit.Infrastructure.EntityFramework.Models;
|
|
|
|
namespace Bit.Infrastructure.EntityFramework.Repositories.Queries
|
|
{
|
|
public class OrganizationUserReadCountByFreeOrganizationAdminUserQuery : IQuery<OrganizationUser>
|
|
{
|
|
private readonly Guid _userId;
|
|
|
|
public OrganizationUserReadCountByFreeOrganizationAdminUserQuery(Guid userId)
|
|
{
|
|
_userId = userId;
|
|
}
|
|
|
|
public IQueryable<OrganizationUser> Run(DatabaseContext dbContext)
|
|
{
|
|
var query = from ou in dbContext.OrganizationUsers
|
|
join o in dbContext.Organizations
|
|
on ou.OrganizationId equals o.Id
|
|
where ou.UserId == _userId &&
|
|
(ou.Type == OrganizationUserType.Owner || ou.Type == OrganizationUserType.Admin) &&
|
|
o.PlanType == PlanType.Free &&
|
|
ou.Status == OrganizationUserStatusType.Confirmed
|
|
select ou;
|
|
|
|
return query;
|
|
}
|
|
}
|
|
}
|