Commit 91995909d9ef6fc5540c7577987ed2244ac7862a
1 parent
0bda2d5d
Exists in
master
and in
4 other branches
Fix #2375. Admin and owner can manage groups
Showing
2 changed files
with
9 additions
and
3 deletions
Show diff stats
app/models/ability.rb
... | ... | @@ -107,9 +107,12 @@ class Ability |
107 | 107 | def group_abilities user, group |
108 | 108 | rules = [] |
109 | 109 | |
110 | - rules << [ | |
111 | - :manage_group | |
112 | - ] if group.owner == user | |
110 | + # Only group owner and administrators can manage group | |
111 | + if group.owner == user || user.admin? | |
112 | + rules << [ | |
113 | + :manage_group | |
114 | + ] | |
115 | + end | |
113 | 116 | |
114 | 117 | rules.flatten |
115 | 118 | end | ... | ... |
app/views/admin/projects/index.html.haml
... | ... | @@ -15,6 +15,7 @@ |
15 | 15 | %i.icon-sort-down |
16 | 16 | %th Path |
17 | 17 | %th Team Members |
18 | + %th Owner | |
18 | 19 | %th Last Commit |
19 | 20 | %th Edit |
20 | 21 | %th.cred Danger Zone! |
... | ... | @@ -26,6 +27,8 @@ |
26 | 27 | %td |
27 | 28 | %span.monospace= project.path_with_namespace + ".git" |
28 | 29 | %td= project.users_projects.count |
30 | + %td | |
31 | + = link_to project.chief.name, [:admin, project.chief] | |
29 | 32 | %td= last_commit(project) |
30 | 33 | %td= link_to 'Edit', edit_admin_project_path(project), id: "edit_#{dom_id(project)}", class: "btn small" |
31 | 34 | %td.bgred= link_to 'Destroy', [:admin, project], confirm: "REMOVE #{project.name}? Are you sure?", method: :delete, class: "btn small danger" | ... | ... |