mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Fix too loose strong parameters in the admin interface
There are some attributes that we don't use and/or that should not be changeable, even by admins.
This commit is contained in:
parent
d588fb00da
commit
d6e36f2845
12 changed files with 12 additions and 14 deletions
|
|
@ -130,8 +130,7 @@ module Admin
|
|||
end
|
||||
|
||||
def booth_params
|
||||
params.require(:booth).permit(:title, :description, :reasoning, :state, :picture, :conference_id,
|
||||
:created_at, :updated_at, :submitter_relationship, :website_url, responsible_ids: [])
|
||||
params.require(:booth).permit(:title, :description, :reasoning, :picture, :website_url, :submitter_relationship, responsible_ids: [])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ module Admin
|
|||
private
|
||||
|
||||
def difficulty_level_params
|
||||
params.require(:difficulty_level).permit(:title, :description, :color, :conference_id)
|
||||
params.require(:difficulty_level).permit(:title, :description, :color)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ module Admin
|
|||
private
|
||||
|
||||
def event_type_params
|
||||
params.require(:event_type).permit(:title, :length, :minimum_abstract_length, :maximum_abstract_length, :color, :conference_id, :description)
|
||||
params.require(:event_type).permit(:title, :length, :minimum_abstract_length, :maximum_abstract_length, :color, :description)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ module Admin
|
|||
end
|
||||
|
||||
def comment_params
|
||||
params.require(:comment).permit(:commentable, :body, :user_id)
|
||||
params.require(:comment).permit(:body)
|
||||
end
|
||||
|
||||
def update_state(transition, notice, mail = false, subject = false, send_mail = false)
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ module Admin
|
|||
private
|
||||
|
||||
def lodging_params
|
||||
params.require(:lodging).permit(:name, :description, :picture, :picture_cache, :website_link, :conference_id)
|
||||
params.require(:lodging).permit(:name, :description, :picture, :picture_cache, :website_link)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ module Admin
|
|||
private
|
||||
|
||||
def question_params
|
||||
params.require(:question).permit(:title, :global, :answer_ids, :question_type_id, :conference_id, answers_attributes: [:id, :title])
|
||||
params.require(:question).permit(:title, :global, :answer_ids, :question_type_id, answers_attributes: [:id, :title])
|
||||
end
|
||||
|
||||
def conference_params
|
||||
|
|
|
|||
|
|
@ -82,8 +82,7 @@ module Admin
|
|||
|
||||
def registration_params
|
||||
params.require(:registration).permit(
|
||||
:user_id, :conference_id, :attended,
|
||||
:volunteer, :other_special_needs, :accepted_code_of_conduct,
|
||||
:attended, :volunteer, :other_special_needs, :accepted_code_of_conduct,
|
||||
vchoice_ids: [], qanswer_ids: [], qanswers_attributes: [], event_ids: []
|
||||
)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ module Admin
|
|||
private
|
||||
|
||||
def resource_params
|
||||
params.require(:resource).permit(:name, :description, :quantity, :used, :conference_id)
|
||||
params.require(:resource).permit(:name, :description, :quantity, :used)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ module Admin
|
|||
private
|
||||
|
||||
def sponsor_params
|
||||
params.require(:sponsor).permit(:name, :description, :website_url, :picture, :picture_cache, :sponsorship_level_id, :conference_id)
|
||||
params.require(:sponsor).permit(:name, :description, :website_url, :picture, :picture_cache, :sponsorship_level_id)
|
||||
end
|
||||
|
||||
def sponsorship_level_required
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ module Admin
|
|||
private
|
||||
|
||||
def sponsorship_level_params
|
||||
params.require(:sponsorship_level).permit(:title, :conference_id)
|
||||
params.require(:sponsorship_level).permit(:title)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ module Admin
|
|||
private
|
||||
|
||||
def ticket_params
|
||||
params.require(:ticket).permit(:conference, :title, :url, :description, :conference_id, :price_cents, :price_currency, :price, :registration_ticket)
|
||||
params.require(:ticket).permit(:title, :url, :description, :price_cents, :price_currency, :price, :registration_ticket)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ module Admin
|
|||
private
|
||||
|
||||
def venue_params
|
||||
params.require(:venue).permit(:name, :street, :postalcode, :city, :country, :longitude, :latitude, :description, :website, :picture, :picture_cache, :lodgings_attributes, :conference_id)
|
||||
params.require(:venue).permit(:name, :street, :postalcode, :city, :country, :longitude, :latitude, :description, :website, :picture, :picture_cache, :lodgings_attributes)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue