mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-19 03:52:25 -05:00
6dd4bc7d57
Group owners are regular users that can add or remove users to a group The Admin UX allows admins to appoint group owners The public group UX will display group owners first and unlock UI to add and remove members Group owners can only be appointed on non automatic groups Group owners may not appoint another group owner
11 lines
391 B
Ruby
11 lines
391 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.users.where('group_users.owner').include?(user) || is_admin?) && !group.automatic
|
|
end
|
|
|
|
end
|