Trigger refreshing of permissions in a migration
This migration resets `users.authorized_projects_populated` (in batches) so that active users' permissions are refreshed on the next request. This ensures that their permissions are properly stored.
This commit is contained in:
parent
32da760268
commit
dbf414df33
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
title: Reset users.authorized_projects_populated to automatically refresh user permissions
|
||||
merge_request:
|
||||
author:
|
|
@ -0,0 +1,19 @@
|
|||
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
|
||||
# for more information on how to write migrations for GitLab.
|
||||
|
||||
class ResetUsersAuthorizedProjectsPopulated < ActiveRecord::Migration
|
||||
include Gitlab::Database::MigrationHelpers
|
||||
|
||||
DOWNTIME = false
|
||||
|
||||
disable_ddl_transaction!
|
||||
|
||||
def up
|
||||
# This ensures we don't lock all users for the duration of the migration.
|
||||
update_column_in_batches(:users, :authorized_projects_populated, nil)
|
||||
end
|
||||
|
||||
def down
|
||||
# noop
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue