diff --git a/app/models/ability.rb b/app/models/ability.rb index 2d80c6720b79da74ae9e4d20d816b2433f3082a8..90929c5b51226c489d4b8552800a8c91a6130023 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -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 diff --git a/app/views/admin/projects/index.html.haml b/app/views/admin/projects/index.html.haml index 0b9f91f7a5f9ed6622d10f89c44e8cd545c40a0f..b56d7faa3027f23b3a9099f887520d0e7bea9965 100644 --- a/app/views/admin/projects/index.html.haml +++ b/app/views/admin/projects/index.html.haml @@ -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"