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