diff options
author | Douwe Maan <douwe@gitlab.com> | 2016-06-17 15:42:49 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2016-06-17 15:42:49 +0000 |
commit | 8c2697eaed73096cf56e6a5e1683008708580710 (patch) | |
tree | 0368813e4952d063707e1460e6cc68406ceedbe8 /app/views | |
parent | 802409571d53469a70ea66dcf24b1214ac525044 (diff) | |
parent | 1c944a22de447dd340cb57188751eedde80a393b (diff) | |
download | gitlab-ce-8c2697eaed73096cf56e6a5e1683008708580710.tar.gz |
Merge branch '18724-dont-show-leave-project-to-group-member' into 'master'
Don't show 'Leave Project' to group members
## What does this MR do?
It hides the 'Leave Project' button to group members that are not explicitly a member of the project.
## Are there points in the code the reviewer needs to double check?
No.
## Why was this MR needed?
Because there was an issue opened!
## What are the relevant issue numbers?
Fixes #18724.
## Does this MR meet the acceptance criteria?
- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- [x] Tests
- [x] Added for this feature/bug
- [x] All builds are passing
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)
See merge request !4739
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/layouts/nav/_project.html.haml | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/views/layouts/nav/_project.html.haml b/app/views/layouts/nav/_project.html.haml index a851cae4b56..39ea4920ccc 100644 --- a/app/views/layouts/nav/_project.html.haml +++ b/app/views/layouts/nav/_project.html.haml @@ -5,18 +5,19 @@ = icon('cog') = icon('caret-down') %ul.dropdown-menu.dropdown-menu-align-right + - is_project_member = @project.users.exists?(current_user.id) - access = @project.team.max_member_access(current_user.id) - can_edit = can?(current_user, :admin_project, @project) = render 'layouts/nav/project_settings', access: access, can_edit: can_edit - - if can_edit || access + - if can_edit || is_project_member %li.divider - if can_edit %li = link_to edit_project_path(@project) do Edit Project - - if access + - if is_project_member %li = link_to polymorphic_path([:leave, @project, :members]), data: { confirm: leave_confirmation_message(@project) }, method: :delete, title: 'Leave project' do |