Fix #2375. Admin and owner can manage groups
This commit is contained in:
parent
0bda2d5d2b
commit
91995909d9
2 changed files with 9 additions and 3 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue