[Catalyst-commits] r9770 - in
trunk/Catalyst-Plugin-Authorization-ACL: .
lib/Catalyst/Plugin/Authorization t/lib/ACLTestApp
t/lib/ACLTestApp/Controller t/lib/ACLTestApp/Controller/Zoo
caelum at dev.catalyst.perl.org
caelum at dev.catalyst.perl.org
Tue Apr 21 03:31:16 GMT 2009
Author: caelum
Date: 2009-04-21 04:31:16 +0100 (Tue, 21 Apr 2009)
New Revision: 9770
Added:
trunk/Catalyst-Plugin-Authorization-ACL/TODO
trunk/Catalyst-Plugin-Authorization-ACL/t/lib/ACLTestApp/Controller/
Removed:
trunk/Catalyst-Plugin-Authorization-ACL/t/lib/ACLTestApp/C/
Modified:
trunk/Catalyst-Plugin-Authorization-ACL/Changes
trunk/Catalyst-Plugin-Authorization-ACL/Makefile.PL
trunk/Catalyst-Plugin-Authorization-ACL/lib/Catalyst/Plugin/Authorization/ACL.pm
trunk/Catalyst-Plugin-Authorization-ACL/t/lib/ACLTestApp/Controller/Auth.pm
trunk/Catalyst-Plugin-Authorization-ACL/t/lib/ACLTestApp/Controller/LionCage.pm
trunk/Catalyst-Plugin-Authorization-ACL/t/lib/ACLTestApp/Controller/Zoo.pm
trunk/Catalyst-Plugin-Authorization-ACL/t/lib/ACLTestApp/Controller/Zoo/Penguins.pm
Log:
ACL: switch to MRO::Compat
Modified: trunk/Catalyst-Plugin-Authorization-ACL/Changes
===================================================================
--- trunk/Catalyst-Plugin-Authorization-ACL/Changes 2009-04-21 01:40:47 UTC (rev 9769)
+++ trunk/Catalyst-Plugin-Authorization-ACL/Changes 2009-04-21 03:31:16 UTC (rev 9770)
@@ -1,5 +1,8 @@
Revision history for Perl extension Catalyst::Plugin::Authorization::ACL
+0.11 2009-04-21
+ - switch from NEXT to MRO::Compat
+
0.10 2008-10-13
- fix access_denied action support
Modified: trunk/Catalyst-Plugin-Authorization-ACL/Makefile.PL
===================================================================
--- trunk/Catalyst-Plugin-Authorization-ACL/Makefile.PL 2009-04-21 01:40:47 UTC (rev 9769)
+++ trunk/Catalyst-Plugin-Authorization-ACL/Makefile.PL 2009-04-21 03:31:16 UTC (rev 9770)
@@ -15,6 +15,13 @@
requires 'Tree::Simple::Visitor::FindByPath';
requires 'Tree::Simple::Visitor::GetAllDescendents';
+requires 'MRO::Compat';
+
+if($] < 5.009_005) {
+ requires 'Class::C3::XS' => '0.08';
+ requires 'Class::C3' => '0.20';
+}
+
test_requires 'Test::More';
WriteAll;
Added: trunk/Catalyst-Plugin-Authorization-ACL/TODO
===================================================================
--- trunk/Catalyst-Plugin-Authorization-ACL/TODO (rev 0)
+++ trunk/Catalyst-Plugin-Authorization-ACL/TODO 2009-04-21 03:31:16 UTC (rev 9770)
@@ -0,0 +1,22 @@
+Need to rewrite ACL/Engiine to get rid of Dispatcher::tree warning:
+
+02:04 <@t0m> Caelum: split the path, call get_containers, call get_action on them.. Something like that..
+02:05 <@t0m> Caelum: They're gonna delegate to methods on the tree anway under the hood, but the tree should be an implementation detail as far as you're concerned.
+02:05 <@t0m> Or, just document how to do it write with Chained, and mark ACL as deprecated :)
+
+Check for any role...earlier on RT:
+
+> If you want to check for either role, do something like this, described in "Flexible Rules":
+>
+> use Catalyst::Plugin::Authorization::ACL::Engine qw/$ALLOWED $DENIED/;
+>
+> __PACAKGE__->deny_access_unless( "/foo/bar", sub {
+> my ($c, $action) = @_;
+> if ($c->check_any_user_role(qw/admin user/)) {
+> die $ALLOWED;
+> } else {
+> die $DENIED;
+> }
+> } );
+>
+> Perhaps we should have a syntax to make this easier?
Modified: trunk/Catalyst-Plugin-Authorization-ACL/lib/Catalyst/Plugin/Authorization/ACL.pm
===================================================================
--- trunk/Catalyst-Plugin-Authorization-ACL/lib/Catalyst/Plugin/Authorization/ACL.pm 2009-04-21 01:40:47 UTC (rev 9769)
+++ trunk/Catalyst-Plugin-Authorization-ACL/lib/Catalyst/Plugin/Authorization/ACL.pm 2009-04-21 03:31:16 UTC (rev 9770)
@@ -4,7 +4,8 @@
use strict;
use warnings;
-use NEXT;
+use MRO::Compat;
+use mro 'c3';
use Scalar::Util ();
use Catalyst::Plugin::Authorization::ACL::Engine;
@@ -13,15 +14,13 @@
BEGIN { __PACKAGE__->mk_classdata("_acl_engine") }
-our $VERSION = '0.10';
+our $VERSION = '0.11';
my $FORCE_ALLOW = bless {}, __PACKAGE__ . "::Exception";
sub execute {
my ( $c, $class, $action ) = @_;
- local $NEXT::NEXT{ $c, "execute" };
-
if ( Scalar::Util::blessed($action)
and $action->name ne "access_denied"
and $action->name ne "ACL error rethrower" )
@@ -38,7 +37,7 @@
}
- $c->NEXT::execute( $class, $action );
+ $c->maybe::next::method( $class, $action );
}
sub acl_allow_root_internals {
@@ -51,7 +50,7 @@
sub setup_actions {
my $app = shift;
- my $ret = $app->NEXT::setup_actions(@_);
+ my $ret = $app->maybe::next::method(@_);
$app->_acl_engine(
Catalyst::Plugin::Authorization::ACL::Engine->new($app) );
Copied: trunk/Catalyst-Plugin-Authorization-ACL/t/lib/ACLTestApp/Controller (from rev 9751, trunk/Catalyst-Plugin-Authorization-ACL/t/lib/ACLTestApp/C)
Modified: trunk/Catalyst-Plugin-Authorization-ACL/t/lib/ACLTestApp/Controller/Auth.pm
===================================================================
--- trunk/Catalyst-Plugin-Authorization-ACL/t/lib/ACLTestApp/C/Auth.pm 2009-04-19 23:25:16 UTC (rev 9751)
+++ trunk/Catalyst-Plugin-Authorization-ACL/t/lib/ACLTestApp/Controller/Auth.pm 2009-04-21 03:31:16 UTC (rev 9770)
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-package ACLTestApp::C::Auth;
+package ACLTestApp::Controller::Auth;
use base qw/Catalyst::Controller/;
use strict;
@@ -30,11 +30,11 @@
=head1 NAME
-ACLTestApp::C::Auth -
+ACLTestApp::Controller::Auth -
=head1 SYNOPSIS
- use ACLTestApp::C::Auth;
+ use ACLTestApp::Controller::Auth;
=head1 DESCRIPTION
Modified: trunk/Catalyst-Plugin-Authorization-ACL/t/lib/ACLTestApp/Controller/LionCage.pm
===================================================================
--- trunk/Catalyst-Plugin-Authorization-ACL/t/lib/ACLTestApp/C/LionCage.pm 2009-04-19 23:25:16 UTC (rev 9751)
+++ trunk/Catalyst-Plugin-Authorization-ACL/t/lib/ACLTestApp/Controller/LionCage.pm 2009-04-21 03:31:16 UTC (rev 9770)
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-package ACLTestApp::C::LionCage;
+package ACLTestApp::Controller::LionCage;
use base qw/Catalyst::Controller/;
use strict;
@@ -19,11 +19,11 @@
=head1 NAME
-ACLTestApp::C::LionCage -
+ACLTestApp::Controller::LionCage -
=head1 SYNOPSIS
- use ACLTestApp::C::LionCage;
+ use ACLTestApp::Controller::LionCage;
=head1 DESCRIPTION
Modified: trunk/Catalyst-Plugin-Authorization-ACL/t/lib/ACLTestApp/Controller/Zoo/Penguins.pm
===================================================================
--- trunk/Catalyst-Plugin-Authorization-ACL/t/lib/ACLTestApp/C/Zoo/Penguins.pm 2009-04-19 23:25:16 UTC (rev 9751)
+++ trunk/Catalyst-Plugin-Authorization-ACL/t/lib/ACLTestApp/Controller/Zoo/Penguins.pm 2009-04-21 03:31:16 UTC (rev 9770)
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-package ACLTestApp::C::Zoo::Penguins;
+package ACLTestApp::Controller::Zoo::Penguins;
use base qw/Catalyst::Controller/;
use strict;
@@ -29,11 +29,11 @@
=head1 NAME
-ACLTestApp::C::Zoo -
+ACLTestApp::Controller::Zoo -
=head1 SYNOPSIS
- use ACLTestApp::C::Zoo;
+ use ACLTestApp::Controller::Zoo;
=head1 DESCRIPTION
Modified: trunk/Catalyst-Plugin-Authorization-ACL/t/lib/ACLTestApp/Controller/Zoo.pm
===================================================================
--- trunk/Catalyst-Plugin-Authorization-ACL/t/lib/ACLTestApp/C/Zoo.pm 2009-04-19 23:25:16 UTC (rev 9751)
+++ trunk/Catalyst-Plugin-Authorization-ACL/t/lib/ACLTestApp/Controller/Zoo.pm 2009-04-21 03:31:16 UTC (rev 9770)
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-package ACLTestApp::C::Zoo;
+package ACLTestApp::Controller::Zoo;
use base qw/Catalyst::Controller/;
use strict;
@@ -29,11 +29,11 @@
=head1 NAME
-ACLTestApp::C::Zoo -
+ACLTestApp::Controller::Zoo -
=head1 SYNOPSIS
- use ACLTestApp::C::Zoo;
+ use ACLTestApp::Controller::Zoo;
=head1 DESCRIPTION
More information about the Catalyst-commits
mailing list