Commit 929ab909 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Group masters should be able to create/close milestones

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 78d542fc
......@@ -38,7 +38,7 @@ class Groups::MilestonesController < Groups::ApplicationController
private
def authorize_group_milestone!
return render_404 unless can?(current_user, :admin_group, group)
return render_404 unless can?(current_user, :admin_milestones, group)
end
def milestone_params
......
......@@ -233,6 +233,7 @@ class Ability
if group.has_master?(user) || group.has_owner?(user) || user.admin?
rules.push(*[
:create_projects,
:admin_milestones
])
end
......
......@@ -22,7 +22,7 @@
%span.label.label-gray
= milestone.project.name
.col-sm-6
- if can?(current_user, :admin_group, @group)
- if can?(current_user, :admin_milestones, @group)
- if milestone.closed?
= link_to 'Reopen Milestone', group_milestone_path(@group, milestone.safe_title, title: milestone.title, milestone: {state_event: :activate }), method: :put, class: "btn btn-xs btn-grouped btn-reopen"
- else
......
......@@ -3,6 +3,7 @@
= render 'shared/milestones_filter'
.gray-content-block
- if can?(current_user, :admin_milestones, @group)
.pull-right
%span.pull-right.hidden-xs
= link_to new_group_milestone_path(@group), class: "btn btn-new" do
......
......@@ -9,7 +9,7 @@
Open
Milestone #{@milestone.title}
.pull-right
- if can?(current_user, :admin_group, @group)
- if can?(current_user, :admin_milestones, @group)
- if @milestone.active?
= link_to 'Close Milestone', group_milestone_path(@group, @milestone.safe_title, title: @milestone.title, milestone: {state_event: :close }), method: :put, class: "btn btn-sm btn-close"
- else
......
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