stories: if the user can't see the story, just return a 404

This commit is contained in:
joshua stein 2017-04-17 12:11:23 -05:00
parent 34bb7b7f91
commit e6ba085507
1 changed files with 3 additions and 4 deletions

View File

@ -127,12 +127,11 @@ class StoriesController < ApplicationController
return redirect_to @story.merged_into_story.comments_path
end
if @story.can_be_seen_by_user?(@user)
@title = @story.title
else
@title = "[Story removed]"
if !@story.can_be_seen_by_user?(@user)
raise ActionController::RoutingError.new("story gone")
end
@title = @story.title
@short_url = @story.short_id_url
@comments = @story.merged_comments.includes(:user, :story, :hat,