rescue_from doesn't seem to catch errors

29 views
Skip to first unread message

Josiah

unread,
Mar 11, 2010, 7:25:23 PM3/11/10
to acl9-discuss
I have an admin dashboard I am trying to secure with acl9.

It is only open to users with the :admin role, which works fine. What
I can't seem to figure out is why this line won't work for me:

rescue_from Acl9::AccessDenied, :with => :access_denied

I keep getting Acl9::AccessDenied exceptions in my cucumber tests (and
when I visit the page manually).

Any idea why? It doesn't seem to call
ApplicationController#access_denied at all.

I was more or less following the tutorial. The only change I made was
to remove the quotes around Acl9::AccessDenied when the copied and
pasted version didn't work either.

Thanks for your help,
Josiah

oleg dashevskii

unread,
Mar 11, 2010, 11:28:54 PM3/11/10
to acl9-d...@googlegroups.com
Does it work in production mode?

2010/3/12 Josiah <blue...@gmail.com>



--
Олег.

Jason Seifer

unread,
Apr 2, 2010, 6:13:01 PM4/2/10
to acl9-discuss
Try setting the following in your Webrat env.rb:

ActionController::Base.allow_rescue = true


On Mar 11, 8:25 pm, Josiah <bluep...@gmail.com> wrote:
> I have an admin dashboard I am trying to secure with acl9.
>
> It is only open to users with the :admin role, which works fine.  What
> I can't seem to figure out is why this line won't work for me:
>
> rescue_from Acl9::AccessDenied, :with => :access_denied
>

> I keep getting Acl9::AccessDenied exceptions in mycucumbertests (and

Reply all
Reply to author
Forward
0 new messages