[Catalyst] Re: ACLs (Matt S Trout)(yourself)
张淼
yourselfzm at gmail.com
Fri May 25 04:33:47 GMT 2007
Thanks,
In my MyAPP.pm
package MyAPP;
use strict;
use warnings;
use Catalyst::Runtime '5.70';
use Catalyst qw/
......
Authentication
Authentication::Store::DBIC
Authentication::Credential::Password
Authorization::Roles
Authorization::ACL
......
/;
__PACKAGE__->config( name =3D> 'MyAPP' );
__PACKAGE__->setup;
......
__PACKAGE__->deny_access_unless(
"/macs/create",
[qw/admin user/]
);
......
In My Macs.pm <http://macs.pm/>
package MyAPP::Controller::Macs;
......
sub access_denied : Private {
my ( $self, $c ) =3D @_;
$c->stash->{error_msg} =3D 'Unauthorized!';
$c->forward('index');
}
......
When I logged as "admin" or "user",
As I access /macs/create, there shows "Unauthorized!" to me.
What's the matter with it?
Thanks a lot!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20070525/8a991=
c17/attachment.htm
More information about the Catalyst
mailing list