mirror of
https://github.com/bitwarden/server.git
synced 2024-11-22 12:15:36 +01:00
[Provider] Prevent including pending organizations in SyncResponse (#1482)
This commit is contained in:
parent
757102fd96
commit
792fb377dd
@ -14,5 +14,6 @@ namespace Bit.Core.Models.Data
|
||||
public bool Enabled { get; set; }
|
||||
public string Permissions { get; set; }
|
||||
public bool UseEvents { get; set; }
|
||||
public ProviderStatusType ProviderStatus { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ namespace Bit.Core.Repositories.EntityFramework.Queries
|
||||
join p in dbContext.Providers
|
||||
on pu.ProviderId equals p.Id into p_g
|
||||
from p in p_g.DefaultIfEmpty()
|
||||
where pu.UserId == _userId && (_status == null || pu.Status == _status)
|
||||
where pu.UserId == _userId && p.Status != ProviderStatusType.Pending && (_status == null || pu.Status == _status)
|
||||
select new { pu, p };
|
||||
return query.Select(x => new ProviderUserProviderDetails()
|
||||
{
|
||||
@ -34,6 +34,7 @@ namespace Bit.Core.Repositories.EntityFramework.Queries
|
||||
Enabled = x.p.Enabled,
|
||||
Permissions = x.pu.Permissions,
|
||||
UseEvents = x.p.UseEvents,
|
||||
ProviderStatus = x.p.Status,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -11,5 +11,6 @@ BEGIN
|
||||
[dbo].[ProviderUserProviderDetailsView]
|
||||
WHERE
|
||||
[UserId] = @UserId
|
||||
AND [ProviderStatus] != 0 -- Not Pending
|
||||
AND (@Status IS NULL OR [Status] = @Status)
|
||||
END
|
||||
|
@ -9,7 +9,8 @@ SELECT
|
||||
PU.[Type],
|
||||
P.[Enabled],
|
||||
PU.[Permissions],
|
||||
P.[UseEvents]
|
||||
P.[UseEvents],
|
||||
P.[Status] ProviderStatus
|
||||
FROM
|
||||
[dbo].[ProviderUser] PU
|
||||
LEFT JOIN
|
||||
|
@ -950,7 +950,8 @@ SELECT
|
||||
PU.[Type],
|
||||
P.[Enabled],
|
||||
PU.[Permissions],
|
||||
P.[UseEvents]
|
||||
P.[UseEvents],
|
||||
P.[Status] ProviderStatus
|
||||
FROM
|
||||
[dbo].[ProviderUser] PU
|
||||
LEFT JOIN
|
||||
@ -976,7 +977,8 @@ BEGIN
|
||||
[dbo].[ProviderUserProviderDetailsView]
|
||||
WHERE
|
||||
[UserId] = @UserId
|
||||
AND (@Status IS NULL OR [Status] = @Status)
|
||||
AND [ProviderStatus] != 0 -- Not Pending
|
||||
AND (@Status IS NULL OR [Status] = @Status)
|
||||
END
|
||||
GO
|
||||
|
Loading…
Reference in New Issue
Block a user