main icon indicating copy to clipboard operation
main copied to clipboard

handle when a user doesn't have access to an event

Open rabble opened this issue 7 years ago • 1 comments

When a user requests a url for an event which isn't in a group which has been randomly chosen as the current one then it throws up a 500 error.

ActiveRecord::RecordNotFound in EventsController#show Couldn't find Event with 'id'=2 [WHERE "events_groups"."group_id" = $1]

Extracted source (around line #39): 37 38 39 40 41

def set_event @event = current_group.events.find(params[:id]) end end

Rails.root: /Users/rabble/code/advocacycommons

Application Trace | Framework Trace | Full Trace app/controllers/events_controller.rb:39:in `set_event' Request

Parameters:

{"id"=>"2"}

This is even if the current user IS a member of that group. We need to catch this and handle it cleanly. Also make sure that scoping happens with cancan.

rabble avatar May 03 '17 19:05 rabble

Need to verify whether this still happens.

Matt-Holland avatar Sep 20 '17 22:09 Matt-Holland