mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 11:48:08 +08:00
SECURITY: don't reveal category details to users that do not have access
This commit is contained in:
@ -117,6 +117,8 @@ class CategoriesController < ApplicationController
|
||||
end
|
||||
|
||||
def show
|
||||
guardian.ensure_can_see!(@category)
|
||||
|
||||
if Category.topic_create_allowed(guardian).where(id: @category.id).exists?
|
||||
@category.permission = CategoryGroup.permission_types[:full]
|
||||
end
|
||||
|
Reference in New Issue
Block a user