1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-07 02:52:50 -05:00

[EC-388] Enforce organization policies when restoring user (#2152)

This commit is contained in:
Thomas Rittson
2022-08-03 07:09:22 +10:00
committed by GitHub
parent da3a3de7f2
commit ebdd30f5d4
8 changed files with 158 additions and 12 deletions

View File

@ -25,11 +25,11 @@ LEFT JOIN
WHERE
(
(
OU.[Status] > 0
OU.[Status] != 0 -- OrgUsers who have accepted their invite and are linked to a UserId
AND OU.[UserId] = @UserId
)
OR (
OU.[Status] = 0 -- 'Invited' OrgUsers are not linked to a UserId yet, so we have to look up their email
OU.[Status] = 0 -- 'Invited' OrgUsers are not linked to a UserId yet, so we have to look up their email
AND OU.[Email] IN (SELECT U.Email FROM [dbo].[UserView] U WHERE U.Id = @UserId)
)
)

View File

@ -1,7 +1,7 @@
CREATE PROCEDURE [dbo].[Policy_CountByTypeApplicableToUser]
@UserId UNIQUEIDENTIFIER,
@PolicyType TINYINT,
@MinimumStatus TINYINT
@MinimumStatus SMALLINT
AS
BEGIN
SET NOCOUNT ON

View File

@ -1,7 +1,7 @@
CREATE PROCEDURE [dbo].[Policy_ReadByTypeApplicableToUser]
@UserId UNIQUEIDENTIFIER,
@PolicyType TINYINT,
@MinimumStatus TINYINT
@MinimumStatus SMALLINT
AS
BEGIN
SET NOCOUNT ON