Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Security issues #7

Open
rootux opened this issue Nov 17, 2016 · 0 comments
Open

Security issues #7

rootux opened this issue Nov 17, 2016 · 0 comments

Comments

@rootux
Copy link

rootux commented Nov 17, 2016

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant