Merge pull request #1352 from BelieveC/ScheduleLogIn
Fixes #1343, Allow viewing public schedule without login
This commit is contained in:
commit
42741fa90b
2 changed files with 6 additions and 1 deletions
|
|
@ -1,7 +1,8 @@
|
||||||
class SchedulesController < ApplicationController
|
class SchedulesController < ApplicationController
|
||||||
|
load_and_authorize_resource
|
||||||
protect_from_forgery with: :null_session
|
protect_from_forgery with: :null_session
|
||||||
before_action :respond_to_options
|
before_action :respond_to_options
|
||||||
load_and_authorize_resource :conference, find_by: :short_title
|
load_resource :conference, find_by: :short_title
|
||||||
load_resource :program, through: :conference, singleton: true, except: :index
|
load_resource :program, through: :conference, singleton: true, except: :index
|
||||||
|
|
||||||
def show
|
def show
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,10 @@ class Ability
|
||||||
can [:new, :create], Event do |event|
|
can [:new, :create], Event do |event|
|
||||||
event.program.cfp_open? && event.new_record?
|
event.program.cfp_open? && event.new_record?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
can [:show, :events], Schedule do |schedule|
|
||||||
|
schedule.program.schedule_public
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue