Skip to content

Commit e29ec14

Browse files
committed
Check guest status before access on pastes
1 parent fa1a82d commit e29ec14

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

app/controllers/submissions_controller.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@ def index
3030
end
3131

3232
def show
33-
if current_user.guest?
34-
raise CanCan::AccessDenied
35-
end
36-
3733
@course ||= @submission.course
3834
@exercise ||= @submission.exercise
3935
@organization = @course.organization
@@ -314,6 +310,10 @@ def index_json_datatables
314310
end
315311

316312
def check_access!
313+
if current_user.guest?
314+
raise CanCan::AccessDenied
315+
end
316+
317317
paste_visible = @submission.paste_visible_for?(current_user)
318318
paste_visibility = @course.paste_visibility || 'open'
319319
case paste_visibility

0 commit comments

Comments
 (0)