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 => '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 ) = @_;
   $c->stash->{error_msg} = '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!
_______________________________________________
List: [email protected]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to