FIX: Show a nicer error when a user tries to access a category they

can't see.
This commit is contained in:
Robin Ward
2014-02-05 15:33:52 -05:00
parent 95585503ac
commit aff16f372b
2 changed files with 10 additions and 0 deletions
+1
View File
@@ -217,6 +217,7 @@ class ListController < ApplicationController
@category = Category.where(slug: slug_or_id, parent_category_id: parent_category_id).includes(:featured_users).first ||
Category.where(id: slug_or_id.to_i, parent_category_id: parent_category_id).includes(:featured_users).first
guardian.ensure_can_see!(@category)
raise Discourse::NotFound.new if @category.blank?
end