mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: add support for group visibility level
There are 4 visibility levels - public (default) - members only - staff - owners Note, admins and group owners ALWAYS have visibility to groups Migration treated old "non public" as "members only"
This commit is contained in:
@@ -20,6 +20,12 @@ class GroupsController < ApplicationController
|
||||
page = params[:page]&.to_i || 0
|
||||
|
||||
groups = Group.visible_groups(current_user)
|
||||
|
||||
unless guardian.is_staff?
|
||||
# hide automatic groups from all non stuff to de-clutter page
|
||||
groups = groups.where(automatic: false)
|
||||
end
|
||||
|
||||
count = groups.count
|
||||
groups = groups.offset(page * page_size).limit(page_size)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user