Access to

5 views
Skip to first unread message

Eric Hu

unread,
Jan 18, 2012, 9:40:03 PM1/18/12
to declarative_...@googlegroups.com

I saw this in the docs:

>Currently, the main means of debugging authorization decisions is logging and exceptions. Denied access to actions is logged to warn or info, including some hints about what went wrong.

>All bang methods throw exceptions which may be used to retrieve more information about a denied access than a Boolean value.

Is there some simple way to get access Denied Access information in Rails/Ruby?  I'd like to pass some of this information to the client for development debugging.  I have quite a few ajax requests and seeing this info in the console would cut down on the number of different windows I'd have to check

Steffen Bartsch

unread,
Jan 19, 2012, 4:06:32 AM1/19/12
to declarative_...@googlegroups.com
Am Donnerstag, 19. Januar 2012 schrieb Eric Hu:
> Is there some simple way to get access Denied Access information in
> Rails/Ruby? I'd like to pass some of this information to the client for
> development debugging. I have quite a few ajax requests and seeing this
> info in the console would cut down on the number of different windows I'd
> have to check

Currently, the detailed information is not passed on from the access filter.
The permission_denied method does not receive the exception as a parameter.

However, if we kept permission_denied backwards compatible, we could pass on
the details as well (see in_controller.rb#130). Patches welcome.

Steffen

Reply all
Reply to author
Forward
0 new messages