Merge pull request from GHSA-569c-22ff-pj3x

This commit is contained in:
Roman Rizzi
2020-01-16 15:17:16 -03:00
committed by GitHub
parent fe588cc7f8
commit 0c4ac2a7bc
3 changed files with 26 additions and 2 deletions

View File

@ -152,7 +152,9 @@ module TopicGuardian
return authenticated? && topic.all_allowed_users.where(id: @user.id).exists?
end
can_see_category?(topic.category)
category = topic.category
can_see_category?(category) &&
(!category.read_restricted || !is_staged? || topic.user == user)
end
def can_get_access_to_topic?(topic)