Commit d1e63c7d authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Reporter cant create MR. Show user authorized projects in Admin area

parent 96ba1708
......@@ -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
......
%h3
Edit access
%small
= @admin_team_member.project.name
&ndash;
= @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
......
- 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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment