You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey - 2 more Security issues -
Anyone with a dream can delete / update dreams that don't belong to them.
please update the following code on the camps_controller (and the relevant fields in the en.yml):
def destroy
@camp = Camp.find(params[:id])
if @camp.creator != current_user
flash[:alert] = "#{t:security_cant_delete_dreams_you_dont_own}"
redirect_to camps_path and return
end
@camp.destroy!
redirect_to camps_path
end
and also add this to update
def update
@camp = Camp.find(params[:id])
if @camp.creator != current_user
flash[:alert] = "#{t:security_cant_edit_dreams_you_dont_own}"
redirect_to camp_path(@camp) and return
end
The text was updated successfully, but these errors were encountered:
Hey - 2 more Security issues -
Anyone with a dream can delete / update dreams that don't belong to them.
please update the following code on the camps_controller (and the relevant fields in the en.yml):
and also add this to update
The text was updated successfully, but these errors were encountered: