X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FManual%2FTutorial%2F06_Authorization.pod;h=84c9ec231949c0e89b5e9753c5c220651e970de2;hb=d5d7ee980cf02b9a519bc006a0f85b965d028ee2;hp=456c5e57a2d19ff61f3950003f2925dc2feec20a;hpb=6c0f71ee33481d3a2793a4e4a94cb6172a4971b2;p=catagits%2FCatalyst-Manual.git diff --git a/lib/Catalyst/Manual/Tutorial/06_Authorization.pod b/lib/Catalyst/Manual/Tutorial/06_Authorization.pod index 456c5e5..84c9ec2 100644 --- a/lib/Catalyst/Manual/Tutorial/06_Authorization.pod +++ b/lib/Catalyst/Manual/Tutorial/06_Authorization.pod @@ -65,7 +65,7 @@ can simplify your code and make things easier to maintain. You can checkout the source code for this example from the catalyst subversion repository as per the instructions in -L. +L. =head1 BASIC AUTHORIZATION @@ -78,21 +78,21 @@ Catalyst. Edit C and add C to the list: - # Load plugins - use Catalyst qw/ - -Debug - ConfigLoader - Static::Simple - - StackTrace - - Authentication - Authorization::Roles - - Session - Session::Store::FastMmap - Session::State::Cookie - /; + # Load plugins + use Catalyst qw/ + -Debug + ConfigLoader + Static::Simple + + StackTrace + + Authentication + Authorization::Roles + + Session + Session::Store::File + Session::State::Cookie + /; Once again, include this additional plugin as a new dependency in the Makefile.PL file like this: @@ -174,7 +174,7 @@ updating C to match the following code: # Assign the Book object to the stash and set template $c->stash(book => $book, - template => 'books/create_done.tt2'); + template => 'books/create_done.tt2'); } else { # Provide very simple feedback to the user. $c->response->body('Unauthorized!'); @@ -255,7 +255,7 @@ this method to our Result Class. Open C and add the following method below the "C" line: - =head 2 has_role + =head2 has_role Check if a user has the specified role @@ -269,6 +269,11 @@ the "C" line: return any(map { $_->role } $self->roles) eq $role; } +Let's also add Perl6::Junction to the requirements listed in +Makefile.PL: + + requires 'Perl6::Junction'; + Now we need to add some enforcement inside our controller. Open C and update the C method to match the following code: @@ -339,10 +344,13 @@ L URL directly) when you are done. Kennedy Clark, C -Please report any errors, issues or suggestions to the author. The -most recent version of the Catalyst Tutorial can be found at +Feel free to contact the author for any errors or suggestions, but the +best way to report issues is via the CPAN RT Bug system at +. + +The most recent version of the Catalyst Tutorial can be found at L. -Copyright 2006-2008, Kennedy Clark, under Creative Commons License +Copyright 2006-2010, Kennedy Clark, under the +Creative Commons Attribution Share-Alike License Version 3.0 (L). -