CanCan Checking Destroy Abilities
Have you ever noticed that CanCan does not perform the ability check on the destroy action of the controllers, even if you authorize_resource ?
You need to add, inside your destroy action, an explicit authorization check, just like:
def destroy
authorize! :destroy, @event
...
end
Check the link for more info:
https://github.com/ryanb/cancan/issues/626
Written by Rafael Oliveira
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#