Don’t know if anyone else has experienced this but I’m having a problem
with the access_denied method in Ezra’s ACL access control plugin. It’s
working fine (in conjunction with acts_as_authenticated) until it comes
across a user it denies access to, in which case it throws the following
error:
NoMethodError in Admin#index
protected method `access_denied' called for
23 if c.respond_to?(:access_denied)
24 c.access_denied
25 else
26 c.send(:render_text, “You have insufficient permissions
to access #{c.controller_name}/#{c.action_name}”)
27 end
If I comment out everything except line 26, it behaves as expected. I’m
still pretty noobish, but can’t work out why 24 should throw an error
when 23 checks that the method exists (and a debug of the controller
methods confirms that). Any ideas?
Thanks in advance
OK. If I add an access_denied method to the controller it works but only
if it is not protected. If it’s protected (which I think it should be)
or not there at all it throws up the no method error. Running 1.1RC1, by
the way.
ChrisT wrote:
Don’t know if anyone else has experienced this but I’m having a problem
with the access_denied method in Ezra’s ACL access control plugin. It’s
working fine (in conjunction with acts_as_authenticated) until it comes
across a user it denies access to, in which case it throws the following
error:
NoMethodError in Admin#index
protected method `access_denied' called for
23 if c.respond_to?(:access_denied)
24 c.access_denied
25 else
26 c.send(:render_text, “You have insufficient permissions
to access #{c.controller_name}/#{c.action_name}”)
27 end
If I comment out everything except line 26, it behaves as expected. I’m
still pretty noobish, but can’t work out why 24 should throw an error
when 23 checks that the method exists (and a debug of the controller
methods confirms that). Any ideas?
Thanks in advance
You will see that the callback methods are now permission_granted
and permission_denied. Other then that a few bugs are fixed. The
reason behind this was that acts_as_auth already defines an
access_denied method that was conflicting with the method in my
plugin. Please use the new version.
I did wonder if the naming of the method might be the problem. I’ll try
it as soon as I’ve just finished this bit of coding. Thanks for
providing the plug-in. Great work