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:
@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user