diff options
| -rw-r--r-- | app/controllers/groups/milestones_controller.rb | 2 | ||||
| -rw-r--r-- | app/models/ability.rb | 1 | ||||
| -rw-r--r-- | app/views/groups/milestones/_milestone.html.haml | 2 | ||||
| -rw-r--r-- | app/views/groups/milestones/index.html.haml | 9 | ||||
| -rw-r--r-- | app/views/groups/milestones/show.html.haml | 2 | 
5 files changed, 9 insertions, 7 deletions
diff --git a/app/controllers/groups/milestones_controller.rb b/app/controllers/groups/milestones_controller.rb index 6833a550c9e..10233222ee1 100644 --- a/app/controllers/groups/milestones_controller.rb +++ b/app/controllers/groups/milestones_controller.rb @@ -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 diff --git a/app/models/ability.rb b/app/models/ability.rb index 5ae28d5133e..d01b3ae6f05 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -233,6 +233,7 @@ class Ability        if group.has_master?(user) || group.has_owner?(user) || user.admin?          rules.push(*[            :create_projects, +          :admin_milestones          ])        end diff --git a/app/views/groups/milestones/_milestone.html.haml b/app/views/groups/milestones/_milestone.html.haml index 41dffdd2fb8..a20bf75bc39 100644 --- a/app/views/groups/milestones/_milestone.html.haml +++ b/app/views/groups/milestones/_milestone.html.haml @@ -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 diff --git a/app/views/groups/milestones/index.html.haml b/app/views/groups/milestones/index.html.haml index ffd7dd3fc0b..84ec77c6188 100644 --- a/app/views/groups/milestones/index.html.haml +++ b/app/views/groups/milestones/index.html.haml @@ -3,10 +3,11 @@  = render 'shared/milestones_filter'  .gray-content-block -  .pull-right -    %span.pull-right.hidden-xs -      = link_to new_group_milestone_path(@group), class: "btn btn-new" do -        New Milestone +  - 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 +          New Milestone    .oneline      Only milestones from diff --git a/app/views/groups/milestones/show.html.haml b/app/views/groups/milestones/show.html.haml index e609abca08e..716e93f558b 100644 --- a/app/views/groups/milestones/show.html.haml +++ b/app/views/groups/milestones/show.html.haml @@ -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  | 
