Commit graph

5 commits

Author SHA1 Message Date
Patrick Bajao
438485ef88 Allow users to create protected branches via CLI
This is for fixing a regression introduced by:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/24969

This fix will allow users who are allowed to push to protected
branches to create protected branches via CLI as well, just
like before. The checks for protected branch creation won't
need to run.
2019-03-21 19:53:04 +08:00
Patrick Bajao
461e397969 Move empty_repo check on its own 2019-03-07 16:57:01 +08:00
Patrick Bajao
333097d765 Allow protected branch creation for empty project 2019-03-07 12:47:31 +08:00
Patrick Bajao
e371520f46 Allow protected branch creation via web and API
This commit includes changes to add `UserAccess#can_create_branch?`
which will check whether the user is allowed to create a branch even
if it matches a protected branch.

This is used in `Gitlab::Checks::BranchCheck` when the branch name
matches a protected branch.

A `push_to_create_protected_branch` ability in `ProjectPolicy` has been
added to allow Developers and above to create protected branches.
2019-03-06 12:20:27 +00:00
Francisco Javier López
6ed50b62e7 CE port Refactor Gitlab::Checks::ChangeAccess class 2018-12-04 11:55:49 +00:00