-
Notifications
You must be signed in to change notification settings - Fork 783
Critical: Nested resources are still accessible #1014
Comments
If you've followed the wiki and used the |
OK.
This is a consequnece of the 'Rails magic'. I didn't realize this. I don't know. Maybe mentioning this problem in Controller Authorization Example - CanCan Wiki could help someone. What do you think? |
I wasn't aware the generator did that now. Of course you can mention that On Saturday, August 30, 2014, Zaijo [email protected] wrote:
Will Gray |
Wiki page Controller Authorization Example is updated and linked to this issue. |
Is there any solutions for this issue yet?
|
@dkonayuki Yes, delete the |
Yes, I did that. It's not working.
|
Abilities defined in blocks don't work with If a user has read access to any education records, the index page will be accessible. I'm assuming you want to filter the records available there. |
Thank you for your reply. |
I figured out how to fix this. By adding these in index action, instead of
|
Following the original guidline in CanCan wiki - Nested Resources leads to unwanted behaviour.
CanCan checks access rights for project given in
params[:project_id]
. It means, that there is still a possibility of bypassing the check for tasks. Consider we have read access to project #5. Navigating toprojects/5/tasks/47
will show task 47 no matter what is it's parent project.To fix this, always set the following in a before_filter
I updated the wiki page, but i need your consent for such advice to public.
Many sites might be vulberable this way.
The text was updated successfully, but these errors were encountered: