Commit ff07a5ab8487bce1d8c46f5c4b28ad54ce99d9cd

Authored by Dmitriy Zaporozhets
2 parents baccb9a4 237ddd60

Merge branch 'improve/developer_permissions' into 'master'

Permissions: Developer can manage issue tracker now
  1 +v 6.6.0
  2 + - Permissions: Developer now can manage issue tracker (modify any issue)
  3 +
1 v 6.5.1 4 v 6.5.1
2 - Fix branch selectbox when create merge request from fork 5 - Fix branch selectbox when create merge request from fork
3 6
app/controllers/projects/blob_controller.rb
@@ -6,6 +6,7 @@ class Projects::BlobController < Projects::ApplicationController @@ -6,6 +6,7 @@ class Projects::BlobController < Projects::ApplicationController
6 before_filter :authorize_read_project! 6 before_filter :authorize_read_project!
7 before_filter :authorize_code_access! 7 before_filter :authorize_code_access!
8 before_filter :require_non_empty_project 8 before_filter :require_non_empty_project
  9 + before_filter :authorize_push!, only: [:destroy]
9 10
10 before_filter :blob 11 before_filter :blob
11 12
app/controllers/projects/edit_tree_controller.rb
1 class Projects::EditTreeController < Projects::BaseTreeController 1 class Projects::EditTreeController < Projects::BaseTreeController
2 before_filter :require_branch_head 2 before_filter :require_branch_head
3 before_filter :blob 3 before_filter :blob
  4 + before_filter :authorize_push!
4 5
5 def show 6 def show
6 @last_commit = Gitlab::Git::Commit.last_for_path(@repository, @ref, @path).sha 7 @last_commit = Gitlab::Git::Commit.last_for_path(@repository, @ref, @path).sha
app/controllers/projects/issues_controller.rb
@@ -9,7 +9,7 @@ class Projects::IssuesController &lt; Projects::ApplicationController @@ -9,7 +9,7 @@ class Projects::IssuesController &lt; Projects::ApplicationController
9 before_filter :authorize_write_issue!, only: [:new, :create] 9 before_filter :authorize_write_issue!, only: [:new, :create]
10 10
11 # Allow modify issue 11 # Allow modify issue
12 - before_filter :authorize_modify_issue!, only: [:edit, :update] 12 + before_filter :authorize_modify_issue!, only: [:edit, :update, :bulk_update]
13 13
14 respond_to :html 14 respond_to :html
15 15
app/controllers/projects/new_tree_controller.rb
1 class Projects::NewTreeController < Projects::BaseTreeController 1 class Projects::NewTreeController < Projects::BaseTreeController
2 before_filter :require_branch_head 2 before_filter :require_branch_head
  3 + before_filter :authorize_push!
3 4
4 def show 5 def show
5 end 6 end
app/models/ability.rb
@@ -125,6 +125,7 @@ class Ability @@ -125,6 +125,7 @@ class Ability
125 project_report_rules + [ 125 project_report_rules + [
126 :write_merge_request, 126 :write_merge_request,
127 :write_wiki, 127 :write_wiki,
  128 + :modify_issue,
128 :push_code 129 :push_code
129 ] 130 ]
130 end 131 end
app/views/help/permissions.html.haml
@@ -101,6 +101,13 @@ @@ -101,6 +101,13 @@
101 %td.permission-x &#10003; 101 %td.permission-x &#10003;
102 %td.permission-x &#10003; 102 %td.permission-x &#10003;
103 %tr 103 %tr
  104 + %td Manage issue tracker
  105 + %td
  106 + %td
  107 + %td.permission-x &#10003;
  108 + %td.permission-x &#10003;
  109 + %td.permission-x &#10003;
  110 + %tr
104 %td Add new team members 111 %td Add new team members
105 %td 112 %td
106 %td 113 %td
app/views/projects/tree/_tree.html.haml
@@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
9 = link_to truncate(title, length: 40), project_tree_path(@project, path) 9 = link_to truncate(title, length: 40), project_tree_path(@project, path)
10 - else 10 - else
11 = link_to title, '#' 11 = link_to title, '#'
12 - - if @repository.branch_names.include?(@ref) 12 + - if current_user && @repository.branch_names.include?(@ref) && current_user.can?(:push_code, @project)
13 %li 13 %li
14 = link_to project_new_tree_path(@project, @id), title: 'New file', id: 'new-file-link' do 14 = link_to project_new_tree_path(@project, @id), title: 'New file', id: 'new-file-link' do
15 %small 15 %small