FIX: Do not return restricted tags without access

This commit is contained in:
Justin DiRose 2020-06-10 16:30:30 -05:00
parent 411a0b5dc6
commit caa15f3567
No known key found for this signature in database
GPG Key ID: D8FDAB7887969D0F
1 changed files with 4 additions and 0 deletions

View File

@ -125,6 +125,10 @@ module KnowledgeExplorer
end
end
allowed_tags = DiscourseTagging.filter_allowed_tags(Guardian.new(@user)).map(&:name)
tags = tags.select { |tag| allowed_tags.include?(tag[:id]) }
tags.sort_by { |tag| [tag[:active] ? 0 : 1, -tag[:count]] }
end