Fix #2375. Admin and owner can manage groups

This commit is contained in:
Dmitriy Zaporozhets 2013-01-02 18:57:02 +02:00
parent 0bda2d5d2b
commit 91995909d9
2 changed files with 9 additions and 3 deletions

View file

@ -107,9 +107,12 @@ class Ability
def group_abilities user, group
rules = []
rules << [
:manage_group
] if group.owner == user
# Only group owner and administrators can manage group
if group.owner == user || user.admin?
rules << [
:manage_group
]
end
rules.flatten
end

View file

@ -15,6 +15,7 @@
%i.icon-sort-down
%th Path
%th Team Members
%th Owner
%th Last Commit
%th Edit
%th.cred Danger Zone!
@ -26,6 +27,8 @@
%td
%span.monospace= project.path_with_namespace + ".git"
%td= project.users_projects.count
%td
= link_to project.chief.name, [:admin, project.chief]
%td= last_commit(project)
%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"