Reporter cant create MR. Show user authorized projects in Admin area
This commit is contained in:
parent
96ba1708ac
commit
d1e63c7df2
6 changed files with 14 additions and 26 deletions
|
@ -57,13 +57,13 @@ class Ability
|
||||||
def project_report_rules
|
def project_report_rules
|
||||||
project_guest_rules + [
|
project_guest_rules + [
|
||||||
:download_code,
|
:download_code,
|
||||||
:write_merge_request,
|
|
||||||
:write_snippet
|
:write_snippet
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
|
|
||||||
def project_dev_rules
|
def project_dev_rules
|
||||||
project_report_rules + [
|
project_report_rules + [
|
||||||
|
:write_merge_request,
|
||||||
:write_wiki,
|
:write_wiki,
|
||||||
:push_code
|
:push_code
|
||||||
]
|
]
|
||||||
|
|
|
@ -191,9 +191,9 @@ class User < ActiveRecord::Base
|
||||||
namespaces: namespaces.map(&:id), user_id: self.id)
|
namespaces: namespaces.map(&:id), user_id: self.id)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Team membership in personal projects
|
# Team membership in authorized projects
|
||||||
def tm_in_personal_projects
|
def tm_in_authorized_projects
|
||||||
UsersProject.where(project_id: personal_projects.map(&:id), user_id: self.id)
|
UsersProject.where(project_id: authorized_projects.map(&:id), user_id: self.id)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns a string for use as a Gitolite user identifier
|
# Returns a string for use as a Gitolite user identifier
|
||||||
|
|
|
@ -1,19 +1,8 @@
|
||||||
%h3
|
%p.slead
|
||||||
Edit access
|
Edit access for
|
||||||
%small
|
= link_to @admin_team_member.user_name, admin_user_path(@admin_team_member)
|
||||||
= @admin_team_member.project.name
|
in
|
||||||
–
|
= link_to @admin_team_member.project.name_with_namespace, admin_project_path(@admin_team_member)
|
||||||
= @admin_team_member.user_name
|
|
||||||
|
|
||||||
%hr
|
%hr
|
||||||
%table.zebra-striped
|
|
||||||
%tr
|
|
||||||
%td User:
|
|
||||||
%td= @admin_team_member.user_name
|
|
||||||
%tr
|
|
||||||
%td Project:
|
|
||||||
%td= @admin_team_member.project.name
|
|
||||||
%tr
|
|
||||||
%td Since:
|
|
||||||
%td= @admin_team_member.updated_at.stamp("Nov 11, 2010")
|
|
||||||
= render 'form'
|
= render 'form'
|
||||||
|
|
|
@ -106,8 +106,8 @@
|
||||||
%td= link_to group.name, admin_group_path(group)
|
%td= link_to group.name, admin_group_path(group)
|
||||||
|
|
||||||
|
|
||||||
- if @admin_user.personal_projects.present?
|
- if @admin_user.authorized_projects.present?
|
||||||
%h5 Personal Projects:
|
%h5 Authorized Projects:
|
||||||
%br
|
%br
|
||||||
|
|
||||||
%table.zebra-striped
|
%table.zebra-striped
|
||||||
|
@ -118,7 +118,7 @@
|
||||||
%th
|
%th
|
||||||
%th
|
%th
|
||||||
|
|
||||||
- @admin_user.tm_in_personal_projects.each do |tm|
|
- @admin_user.tm_in_authorized_projects.each do |tm|
|
||||||
- project = tm.project
|
- project = tm.project
|
||||||
%tr
|
%tr
|
||||||
%td= link_to project.name_with_namespace, admin_project_path(project)
|
%td= link_to project.name_with_namespace, admin_project_path(project)
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
%li Write on project wall
|
%li Write on project wall
|
||||||
%li Pull project code
|
%li Pull project code
|
||||||
%li Download project
|
%li Download project
|
||||||
%li Create new merge request
|
|
||||||
%li Create a code snippets
|
%li Create a code snippets
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
- if can? current_user, :write_issue, @project
|
- if can? current_user, :write_merge_request, @project
|
||||||
= link_to new_project_merge_request_path(@project), class: "right btn primary", title: "New Merge Request" do
|
= link_to new_project_merge_request_path(@project), class: "right btn primary", title: "New Merge Request" do
|
||||||
%i.icon-plus
|
%i.icon-plus
|
||||||
New Merge Request
|
New Merge Request
|
||||||
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
.row
|
.row
|
||||||
.span3
|
.span3
|
||||||
= render 'filter', entity: 'issue'
|
= render 'filter'
|
||||||
.span9
|
.span9
|
||||||
.ui-box
|
.ui-box
|
||||||
.title
|
.title
|
||||||
|
|
Loading…
Reference in a new issue