Commit 9b5e7122 authored by Robert Speicher's avatar Robert Speicher

Merge branch '5561-wip-protected-branches-api-fails-if-adding-user' into 'master'

Resolve "Protected Branches API fails if adding user"

Closes #5561

See merge request gitlab-org/gitlab-ee!5238
parents 1e4a88d4 5dbeb6f1
......@@ -30,7 +30,7 @@ module EE
group_ids = @merge_params.group_ids + @push_params.group_ids + @unprotect_params.group_ids # rubocop:disable Gitlab/ModuleWithInstanceVariables
allowed_groups = @project.invited_groups.where(id: group_ids) # rubocop:disable Gitlab/ModuleWithInstanceVariables
group_ids.count == allowed_groups.count
group_ids.uniq.count == allowed_groups.count
end
# rubocop: enable CodeReuse/ActiveRecord
......@@ -39,7 +39,7 @@ module EE
user_ids = @merge_params.user_ids + @push_params.user_ids + @unprotect_params.user_ids # rubocop:disable Gitlab/ModuleWithInstanceVariables
allowed_users = @project.team.users.where(id: user_ids) # rubocop:disable Gitlab/ModuleWithInstanceVariables
user_ids.count == allowed_users.count
user_ids.uniq.count == allowed_users.count
end
# rubocop: enable CodeReuse/ActiveRecord
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment