mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-24 08:09:13 -05:00
12 lines
367 B
Ruby
12 lines
367 B
Ruby
|
#mixin for all guardian methods dealing with group permissions
|
||
|
module GroupGuardian
|
||
|
|
||
|
# Edit authority for groups means membership changes only.
|
||
|
# Automatic groups are not represented in the GROUP_USERS
|
||
|
# table and thus do not allow membership changes.
|
||
|
def can_edit_group?(group)
|
||
|
(group.managers.include?(user) || is_admin?) && !group.automatic
|
||
|
end
|
||
|
|
||
|
end
|