1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-12 21:27:35 -05:00

[AC-1682] Added script to update [dbo].[CollectionUser] with [Manage] = 1 for all users with Manager role or 'EditAssignedCollections' permission

This commit is contained in:
Rui Tome
2023-11-10 16:18:47 +00:00
parent e14ba4ddb1
commit 1527af7017
3 changed files with 19 additions and 7 deletions

View File

@ -1,10 +1,10 @@
-- Step 1: Retrieve relevant data from [dbo].[Group] where [AccessAll] is 1
-- Step 1: Retrieve Groups with [AccessAll] permission
SELECT [Id] AS [GroupId], [OrganizationId]
INTO #TempGroup
FROM [dbo].[Group]
WHERE [AccessAll] = 1;
-- Step 2: Declare variables for group and organization IDs
-- Step 2: Declare variables for GroupId and OrganizationId
DECLARE @GroupId UNIQUEIDENTIFIER;
DECLARE @OrganizationId UNIQUEIDENTIFIER;
@ -33,7 +33,7 @@ UPDATE SET
INSERT ([CollectionId], [GroupId], [ReadOnly], [HidePasswords], [Manage])
VALUES (source.[CollectionId], source.[GroupId], 0, 0, 1);
-- Step 6: Fetch the next group and organization IDs
-- Step 6: Fetch the next GroupId and OrganizationId
FETCH NEXT FROM GroupCursor INTO @GroupId, @OrganizationId;
END;