SECURITY: don't reveal category details to users that do not have access

This commit is contained in:
Arpit Jalan
2019-08-19 12:38:28 +05:30
parent 897cdfb596
commit 24f94c40a6
2 changed files with 29 additions and 0 deletions

View File

@ -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