1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-06 10:32:49 -05:00

org enabeld check on user assets

This commit is contained in:
Kyle Spearrin
2017-04-11 10:19:19 -04:00
parent c28106c81b
commit 53a25b908a
8 changed files with 22 additions and 4 deletions

View File

@ -14,10 +14,13 @@ BEGIN
[dbo].[Cipher] C ON SC.[CipherId] = C.[Id]
INNER JOIN
[dbo].[OrganizationUser] OU ON OU.Id = SU.OrganizationUserId AND OU.OrganizationId = C.OrganizationId
INNER JOIN
[dbo].[Organization] O ON O.Id = C.OrganizationId
WHERE
C.[Id] = @CipherId
AND OU.[UserId] = @UserId
AND OU.[Status] = 2 -- 2 = Confirmed
AND O.[Enabled] = 1
)
SELECT
@CanEdit = CASE WHEN COUNT(1) > 0 THEN 1 ELSE 0 END