Commit 91995909 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix #2375. Admin and owner can manage groups

parent 0bda2d5d
...@@ -107,9 +107,12 @@ class Ability ...@@ -107,9 +107,12 @@ class Ability
def group_abilities user, group def group_abilities user, group
rules = [] rules = []
rules << [ # Only group owner and administrators can manage group
:manage_group if group.owner == user || user.admin?
] if group.owner == user rules << [
:manage_group
]
end
rules.flatten rules.flatten
end end
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
%i.icon-sort-down %i.icon-sort-down
%th Path %th Path
%th Team Members %th Team Members
%th Owner
%th Last Commit %th Last Commit
%th Edit %th Edit
%th.cred Danger Zone! %th.cred Danger Zone!
...@@ -26,6 +27,8 @@ ...@@ -26,6 +27,8 @@
%td %td
%span.monospace= project.path_with_namespace + ".git" %span.monospace= project.path_with_namespace + ".git"
%td= project.users_projects.count %td= project.users_projects.count
%td
= link_to project.chief.name, [:admin, project.chief]
%td= last_commit(project) %td= last_commit(project)
%td= link_to 'Edit', edit_admin_project_path(project), id: "edit_#{dom_id(project)}", class: "btn small" %td= link_to 'Edit', edit_admin_project_path(project), id: "edit_#{dom_id(project)}", class: "btn small"
%td.bgred= link_to 'Destroy', [:admin, project], confirm: "REMOVE #{project.name}? Are you sure?", method: :delete, class: "btn small danger" %td.bgred= link_to 'Destroy', [:admin, project], confirm: "REMOVE #{project.name}? Are you sure?", method: :delete, class: "btn small danger"
......
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