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

[AC-1682] Moved data migration scripts to DbScripts_transition folder

This commit is contained in:
Rui Tome
2023-11-13 15:46:16 +00:00
parent 577e591068
commit 23a3e5c83c
3 changed files with 0 additions and 0 deletions

View File

@ -0,0 +1,12 @@
-- Update [dbo].[CollectionUser] with [Manage] = 1 for all users with Manager role or 'EditAssignedCollections' permission
UPDATE cu
SET cu.[ReadOnly] = 0,
cu.[HidePasswords] = 0,
cu.[Manage] = 1
FROM [dbo].[CollectionUser] cu
JOIN [dbo].[Collection] c
ON cu.[CollectionId] = c.[Id]
JOIN [dbo].[OrganizationUser] ou
ON cu.[OrganizationUserId] = ou.[Id]
WHERE (ou.[Type] = 3 OR (ou.[Permissions] IS NOT NULL AND
ISJSON(ou.[Permissions]) > 0 AND JSON_VALUE(ou.[Permissions], '$.editAssignedCollections') = 'true'))