-
Notifications
You must be signed in to change notification settings - Fork 72
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
proj. danebook #32
base: master
Are you sure you want to change the base?
proj. danebook #32
Conversation
end | ||
|
||
def destroy | ||
@user = User.find(params[:user_id]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the user has to be in here, since you don't user the user.
end | ||
end | ||
|
||
def destroy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
by not using current user in this, I think you leave yourself open to someone being to change the params within the element and then delete posts that are not theirs. I'll check it out in the live app and let you know.
Update: Yes, I can delete posts that are not mine, by going to the delete link in the post that is mine and changing the href.
No description provided.