mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 13:51:18 +08:00
FIX: Do not show visibility topic if visible (#16478)
It used to show the warning that said only members of certain groups could view the topic even if the group "everyone" was listed in category's permission list.
This commit is contained in:
@ -255,7 +255,12 @@ class CategoriesController < ApplicationController
|
||||
|
||||
def visible_groups
|
||||
@guardian.ensure_can_see!(@category)
|
||||
render json: success_json.merge(groups: @category.groups.merge(Group.visible_groups(current_user)).pluck("name"))
|
||||
|
||||
groups = if !@category.groups.exists?(id: Group::AUTO_GROUPS[:everyone])
|
||||
@category.groups.merge(Group.visible_groups(current_user)).pluck("name")
|
||||
end
|
||||
|
||||
render json: success_json.merge(groups: groups || [])
|
||||
end
|
||||
|
||||
private
|
||||
|
Reference in New Issue
Block a user