mirror of
https://github.com/bitwarden/server.git
synced 2025-02-19 02:21:21 +01:00
[AC-1682] Modified AccessAllCollectionUsers script to bump revision date by each OrgUser
This commit is contained in:
parent
a214c60268
commit
ee43767c84
@ -36,27 +36,27 @@ SET [AccessAll] = 0
|
|||||||
FROM [dbo].[OrganizationUser] OU
|
FROM [dbo].[OrganizationUser] OU
|
||||||
INNER JOIN #TempOrgUser T ON OU.[Id] = T.[OrganizationUserId]
|
INNER JOIN #TempOrgUser T ON OU.[Id] = T.[OrganizationUserId]
|
||||||
|
|
||||||
-- Step 5: Bump the account revision date for each unique OrganizationId in #TempOrgUser
|
-- Step 5: Bump the account revision date for each unique OrganizationUserId in #TempOrgUser
|
||||||
DECLARE @OrganizationId UNIQUEIDENTIFIER
|
DECLARE @OrganizationUserId UNIQUEIDENTIFIER
|
||||||
|
|
||||||
DECLARE OrgIdCursor CURSOR FOR
|
DECLARE OrgUserIdCursor CURSOR FOR
|
||||||
SELECT DISTINCT [OrganizationId]
|
SELECT DISTINCT [OrganizationUserId]
|
||||||
FROM #TempOrgUser
|
FROM #TempOrgUser
|
||||||
|
|
||||||
OPEN OrgIdCursor
|
OPEN OrgUserIdCursor
|
||||||
FETCH NEXT FROM OrgIdCursor INTO @OrganizationId
|
FETCH NEXT FROM OrgUserIdCursor INTO @OrganizationUserId
|
||||||
|
|
||||||
WHILE (@@FETCH_STATUS = 0)
|
WHILE (@@FETCH_STATUS = 0)
|
||||||
BEGIN
|
BEGIN
|
||||||
-- Execute the stored procedure for the current OrganizationId
|
-- Execute the stored procedure for the current OrganizationUserId
|
||||||
EXEC [dbo].[User_BumpAccountRevisionDateByOrganizationId] @OrganizationId
|
EXEC [dbo].[User_BumpAccountRevisionDateByOrganizationUserId] @OrganizationUserId
|
||||||
|
|
||||||
-- Fetch the next OrganizationId
|
-- Fetch the next OrganizationUserId
|
||||||
FETCH NEXT FROM OrgIdCursor INTO @OrganizationId
|
FETCH NEXT FROM OrgUserIdCursor INTO @OrganizationUserId
|
||||||
END
|
END
|
||||||
|
|
||||||
CLOSE OrgIdCursor
|
CLOSE OrgUserIdCursor
|
||||||
DEALLOCATE OrgIdCursor;
|
DEALLOCATE OrgUserIdCursor;
|
||||||
|
|
||||||
-- Step 6: Drop the temporary table
|
-- Step 6: Drop the temporary table
|
||||||
DROP TABLE #TempOrgUser;
|
DROP TABLE #TempOrgUser;
|
||||||
|
Loading…
Reference in New Issue
Block a user