Skip to content
Snippets Groups Projects
Commit 91995909 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Fix #2375. Admin and owner can manage groups

parent 0bda2d5d
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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
Loading
Loading
Loading
Loading
@@ -15,6 +15,7 @@
%i.icon-sort-down
%th Path
%th Team Members
%th Owner
%th Last Commit
%th Edit
%th.cred Danger Zone!
Loading
Loading
@@ -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"
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment