Commit d1e63c7df285740db9672ba023383c83b83fd03b
1 parent
96ba1708
Exists in
master
and in
4 other branches
Reporter cant create MR. Show user authorized projects in Admin area
Showing
6 changed files
with
14 additions
and
26 deletions
Show diff stats
app/models/ability.rb
| ... | ... | @@ -57,13 +57,13 @@ class Ability |
| 57 | 57 | def project_report_rules |
| 58 | 58 | project_guest_rules + [ |
| 59 | 59 | :download_code, |
| 60 | - :write_merge_request, | |
| 61 | 60 | :write_snippet |
| 62 | 61 | ] |
| 63 | 62 | end |
| 64 | 63 | |
| 65 | 64 | def project_dev_rules |
| 66 | 65 | project_report_rules + [ |
| 66 | + :write_merge_request, | |
| 67 | 67 | :write_wiki, |
| 68 | 68 | :push_code |
| 69 | 69 | ] | ... | ... |
app/models/user.rb
| ... | ... | @@ -191,9 +191,9 @@ class User < ActiveRecord::Base |
| 191 | 191 | namespaces: namespaces.map(&:id), user_id: self.id) |
| 192 | 192 | end |
| 193 | 193 | |
| 194 | - # Team membership in personal projects | |
| 195 | - def tm_in_personal_projects | |
| 196 | - UsersProject.where(project_id: personal_projects.map(&:id), user_id: self.id) | |
| 194 | + # Team membership in authorized projects | |
| 195 | + def tm_in_authorized_projects | |
| 196 | + UsersProject.where(project_id: authorized_projects.map(&:id), user_id: self.id) | |
| 197 | 197 | end |
| 198 | 198 | |
| 199 | 199 | # Returns a string for use as a Gitolite user identifier | ... | ... |
app/views/admin/team_members/edit.html.haml
| 1 | -%h3 | |
| 2 | - Edit access | |
| 3 | - %small | |
| 4 | - = @admin_team_member.project.name | |
| 5 | - – | |
| 6 | - = @admin_team_member.user_name | |
| 1 | +%p.slead | |
| 2 | + Edit access for | |
| 3 | + = link_to @admin_team_member.user_name, admin_user_path(@admin_team_member) | |
| 4 | + in | |
| 5 | + = link_to @admin_team_member.project.name_with_namespace, admin_project_path(@admin_team_member) | |
| 7 | 6 | |
| 8 | 7 | %hr |
| 9 | -%table.zebra-striped | |
| 10 | - %tr | |
| 11 | - %td User: | |
| 12 | - %td= @admin_team_member.user_name | |
| 13 | - %tr | |
| 14 | - %td Project: | |
| 15 | - %td= @admin_team_member.project.name | |
| 16 | - %tr | |
| 17 | - %td Since: | |
| 18 | - %td= @admin_team_member.updated_at.stamp("Nov 11, 2010") | |
| 19 | 8 | = render 'form' | ... | ... |
app/views/admin/users/show.html.haml
| ... | ... | @@ -106,8 +106,8 @@ |
| 106 | 106 | %td= link_to group.name, admin_group_path(group) |
| 107 | 107 | |
| 108 | 108 | |
| 109 | -- if @admin_user.personal_projects.present? | |
| 110 | - %h5 Personal Projects: | |
| 109 | +- if @admin_user.authorized_projects.present? | |
| 110 | + %h5 Authorized Projects: | |
| 111 | 111 | %br |
| 112 | 112 | |
| 113 | 113 | %table.zebra-striped |
| ... | ... | @@ -118,7 +118,7 @@ |
| 118 | 118 | %th |
| 119 | 119 | %th |
| 120 | 120 | |
| 121 | - - @admin_user.tm_in_personal_projects.each do |tm| | |
| 121 | + - @admin_user.tm_in_authorized_projects.each do |tm| | |
| 122 | 122 | - project = tm.project |
| 123 | 123 | %tr |
| 124 | 124 | %td= link_to project.name_with_namespace, admin_project_path(project) | ... | ... |
app/views/help/permissions.html.haml
app/views/merge_requests/index.html.haml
| 1 | -- if can? current_user, :write_issue, @project | |
| 1 | +- if can? current_user, :write_merge_request, @project | |
| 2 | 2 | = link_to new_project_merge_request_path(@project), class: "right btn primary", title: "New Merge Request" do |
| 3 | 3 | %i.icon-plus |
| 4 | 4 | New Merge Request |
| ... | ... | @@ -10,7 +10,7 @@ |
| 10 | 10 | |
| 11 | 11 | .row |
| 12 | 12 | .span3 |
| 13 | - = render 'filter', entity: 'issue' | |
| 13 | + = render 'filter' | |
| 14 | 14 | .span9 |
| 15 | 15 | .ui-box |
| 16 | 16 | .title | ... | ... |