diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-05-23 10:06:22 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-05-23 10:06:22 +0400 |
commit | 9e6466c78442075e0f8fb8fe317ffe53dfcb5a95 (patch) | |
tree | b36877c3b8957449210bb0739d201a68c3c6e1f0 /app/views | |
parent | eee14a0c740b53dfba50e1b091d4017ada92ee97 (diff) | |
parent | b9d1fc2f3bdebe541795d6ef6e94da9e98b043d3 (diff) |
Merge branch 'api-remove-branch' into 'master'
New rules for protected branches
This MR change permissions logic for branch removal. Changes listed below:
Before
* developer can remove branch with terminal but not in UI
* masters can remove any branch with UI even protected one
* force-push to protected branch is not allowed but remove is allowed
After
* none can force push or remove protected branches
* developers and masters can remove normal branches with console and UI
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/projects/branches/_branch.html.haml | 4 | ||||
-rw-r--r-- | app/views/projects/protected_branches/index.html.haml | 10 |
2 files changed, 7 insertions, 7 deletions
diff --git a/app/views/projects/branches/_branch.html.haml b/app/views/projects/branches/_branch.html.haml index f0731977098..87f4dd88c27 100644 --- a/app/views/projects/branches/_branch.html.haml +++ b/app/views/projects/branches/_branch.html.haml @@ -16,8 +16,8 @@ %i.icon-copy Compare - - if can?(current_user, :admin_project, @project) && branch.name != @repository.root_ref - = link_to project_branch_path(@project, branch.name), class: 'btn btn-grouped btn-small remove-row', method: :delete, data: { confirm: 'Removed branch cannot be restored. Are you sure?'}, remote: true do + - if can_remove_branch?(@project, branch.name) + = link_to project_branch_path(@project, branch.name), class: 'btn btn-grouped btn-small btn-remove remove-row', method: :delete, data: { confirm: 'Removed branch cannot be restored. Are you sure?'}, remote: true do %i.icon-trash - if commit diff --git a/app/views/projects/protected_branches/index.html.haml b/app/views/projects/protected_branches/index.html.haml index 4a6e8943a9f..e9f67b671bf 100644 --- a/app/views/projects/protected_branches/index.html.haml +++ b/app/views/projects/protected_branches/index.html.haml @@ -4,12 +4,12 @@ = render "projects/branches/filter" .col-md-9 .bs-callout.bs-callout-info - %p Protected branches designed to prevent push for all except #{link_to "masters", help_permissions_path, class: "vlink"}. - %p This ability allows: + %p Protected branches designed to %ul - %li keep stable branches secured - %li forced code review before merge to protected branches - %li prevents branch from force push + %li prevent push for all except #{link_to "masters", help_permissions_path, class: "vlink"}. + %li prevent branch from force push + %li prevent branch from removal + %p This ability allows to keep stable branches secured and force code review before merge to protected branches %p Read more about project permissions #{link_to "here", help_permissions_path, class: "underlined-link"} - if can? current_user, :admin_project, @project |