Not having a valid EE license can lead to weird side effects when testing new features

@jschatz1 was trying to test protected branches on an EE instance and noticed sometimes that the dropdown did not populate with the users.

We dug into the AutocompleteController and found that leaving out the push_code parameter made the endpoint return the right values. What's weird is that in some cases, the autocomplete endpoint DID return the right values. After more investigation, we found that ProjectPolicy was adding rules that would essentially deny the user :push_code access: https://gitlab.com/gitlab-org/gitlab-ee/blob/master/app/policies/project_policy.rb#L209-215. Essentially, the user HAD the ability to :push_code but also was DENIED the ability to :push_code.

It seems a little odd to make these user permissions dynamic this way. It seems that we should just block git pushes in one location rather than make it a user-by-user permission.

Assignee Loading
Time tracking Loading