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

This commit is contained in:
Carl Chenet 2017-05-23 10:50:37 +02:00
parent 1b79d6dd45
commit f9d46c666b

View file

@ -126,12 +126,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,