mirror of
https://github.com/bitwarden/server.git
synced 2025-04-06 05:28:15 -05: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 bool Enabled { get; set; }
|
||||||
public string Permissions { get; set; }
|
public string Permissions { get; set; }
|
||||||
public bool UseEvents { 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
|
join p in dbContext.Providers
|
||||||
on pu.ProviderId equals p.Id into p_g
|
on pu.ProviderId equals p.Id into p_g
|
||||||
from p in p_g.DefaultIfEmpty()
|
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 };
|
select new { pu, p };
|
||||||
return query.Select(x => new ProviderUserProviderDetails()
|
return query.Select(x => new ProviderUserProviderDetails()
|
||||||
{
|
{
|
||||||
@ -34,6 +34,7 @@ namespace Bit.Core.Repositories.EntityFramework.Queries
|
|||||||
Enabled = x.p.Enabled,
|
Enabled = x.p.Enabled,
|
||||||
Permissions = x.pu.Permissions,
|
Permissions = x.pu.Permissions,
|
||||||
UseEvents = x.p.UseEvents,
|
UseEvents = x.p.UseEvents,
|
||||||
|
ProviderStatus = x.p.Status,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,5 +11,6 @@ BEGIN
|
|||||||
[dbo].[ProviderUserProviderDetailsView]
|
[dbo].[ProviderUserProviderDetailsView]
|
||||||
WHERE
|
WHERE
|
||||||
[UserId] = @UserId
|
[UserId] = @UserId
|
||||||
|
AND [ProviderStatus] != 0 -- Not Pending
|
||||||
AND (@Status IS NULL OR [Status] = @Status)
|
AND (@Status IS NULL OR [Status] = @Status)
|
||||||
END
|
END
|
||||||
|
@ -9,7 +9,8 @@ SELECT
|
|||||||
PU.[Type],
|
PU.[Type],
|
||||||
P.[Enabled],
|
P.[Enabled],
|
||||||
PU.[Permissions],
|
PU.[Permissions],
|
||||||
P.[UseEvents]
|
P.[UseEvents],
|
||||||
|
P.[Status] ProviderStatus
|
||||||
FROM
|
FROM
|
||||||
[dbo].[ProviderUser] PU
|
[dbo].[ProviderUser] PU
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
|
@ -950,7 +950,8 @@ SELECT
|
|||||||
PU.[Type],
|
PU.[Type],
|
||||||
P.[Enabled],
|
P.[Enabled],
|
||||||
PU.[Permissions],
|
PU.[Permissions],
|
||||||
P.[UseEvents]
|
P.[UseEvents],
|
||||||
|
P.[Status] ProviderStatus
|
||||||
FROM
|
FROM
|
||||||
[dbo].[ProviderUser] PU
|
[dbo].[ProviderUser] PU
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
@ -976,7 +977,8 @@ BEGIN
|
|||||||
[dbo].[ProviderUserProviderDetailsView]
|
[dbo].[ProviderUserProviderDetailsView]
|
||||||
WHERE
|
WHERE
|
||||||
[UserId] = @UserId
|
[UserId] = @UserId
|
||||||
AND (@Status IS NULL OR [Status] = @Status)
|
AND [ProviderStatus] != 0 -- Not Pending
|
||||||
|
AND (@Status IS NULL OR [Status] = @Status)
|
||||||
END
|
END
|
||||||
GO
|
GO
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user