Fix authorization of conference versions

This commit is contained in:
Stella Rouzi 2017-07-11 23:47:34 +03:00
parent a61327f728
commit fe8c7bb83f

View file

@ -7,8 +7,7 @@ module Admin
@conf_ids_with_role = current_user.is_admin? ? Conference.pluck(:short_title) : Conference.with_role([:organizer, :cfp, :info_desk], current_user).pluck(:short_title) @conf_ids_with_role = current_user.is_admin? ? Conference.pluck(:short_title) : Conference.with_role([:organizer, :cfp, :info_desk], current_user).pluck(:short_title)
return if @conference.blank? return if @conference.blank?
authorize! :index, PaperTrail::Version.new(conference_id: @conference.id) @versions = PaperTrail::Version.where(conference_id: @conference.id).accessible_by(current_ability)
@versions = @versions.where(conference_id: @conference.id)
end end
def revert_attribute def revert_attribute