diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-06 00:09:40 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-06 00:09:40 +0300 |
commit | ad9eb72915f1be40da3ebe287274fe2bae62e46b (patch) | |
tree | e5a029b2edbce0e84a54b6ff4d18e8240680c4c4 /app/services/groups | |
parent | f8d20b20be74c283fe8bfe81abfd2d132a500968 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/groups')
-rw-r--r-- | app/services/groups/transfer_service.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/services/groups/transfer_service.rb b/app/services/groups/transfer_service.rb index 885f5c1edd0..22d7a0a99db 100644 --- a/app/services/groups/transfer_service.rb +++ b/app/services/groups/transfer_service.rb @@ -37,6 +37,7 @@ module Groups # Overridden in EE def post_update_hooks(updated_project_ids) + refresh_project_authorizations end def ensure_allowed_transfer @@ -136,6 +137,16 @@ module Groups @group.add_owner(current_user) end + def refresh_project_authorizations + ProjectAuthorization.where(project_id: @group.all_projects.select(:id)).delete_all # rubocop: disable CodeReuse/ActiveRecord + + # refresh authorized projects for current_user immediately + current_user.refresh_authorized_projects + + # schedule refreshing projects for all the members of the group + @group.refresh_members_authorized_projects + end + def raise_transfer_error(message) raise TransferError, localized_error_messages[message] end |