app/models/ability.rb
# Abilities for not signed in users (guests)
Abilities for not signed in users (guests)
Abilities for not signed in users ( guests )
def not_signed_in
    can [:index, :conferences, :code_of_conduct], Organization
    can [:index], Conference
    can [:show], Conference do |conference|
      conference.splashpage&.public == true
    end
    can [:schedule, :events], Conference do |conference|
      conference.program.cfp && conference.program.schedule_public
    end
    can :show, Event do |event|
      event.state == 'confirmed'
    end
    can :show, Commercial, commercialable_type: 'Event', commercialable_id: Event.where(state: 'confirmed').pluck(:id)
    can [:show, :create], User
    unless ENV['OSEM_ICHAIN_ENABLED'] == 'true'
      can :show, Registration do |registration|
        registration.new_record?
      end
      can [:new, :create], Registration do |registration|
        conference = registration.conference
        conference.registration_open? && registration.new_record? && !conference.registration_limit_exceeded?
      end
      can :show, Event do |event|
        event.new_record?
      end
      can [:new, :create], Event do |event|
        event.program.cfp_open? && event.new_record?
      end
      can [:show, :events], Schedule do |schedule|
        schedule.program.schedule_public
      end
      can [:index, :show], Survey, surveyable_type: 'Conference'
    end
  end
def not_signed_in can [ :index , :conferences , :code_of_conduct ] , Organization can [ :index ] , Conference can [ :show ] , Conference do | conference | conference . splashpage &. public == true end can [ :schedule , :events ] , Conference do | conference | conference . program . cfp && conference . program . schedule_public end can :show , Event do | event | event . state == 'confirmed' end can :show , Commercial , commercialable_type : 'Event' , commercialable_id : Event . where ( state : 'confirmed' ) . pluck ( :id ) can [ :show , :create ] , User unless ENV [ 'OSEM_ICHAIN_ENABLED' ] == 'true' can :show , Registration do | registration | registration . new_record? end can [ :new , :create ] , Registration do | registration | conference = registration . conference conference . registration_open? && registration . new_record? && ! conference . registration_limit_exceeded? end can :show , Event do | event | event . new_record? end can [ :new , :create ] , Event do | event | event . program . cfp_open? && event . new_record? end can [ :show , :events ] , Schedule do | schedule | schedule . program . schedule_public end can [ :index , :show ] , Survey , surveyable_type : 'Conference' end end
Abilities for not signed in users (guests)
Abilities for not signed in users ( guests )
# Can view the schedule # can view Commercials of confirmed Events