minor change to chapter 6 POD
[catagits/Catalyst-Manual.git] / lib / Catalyst / Manual / Tutorial / 06_Authorization.pod
index cda2f7b..9302abb 100644 (file)
@@ -79,7 +79,8 @@ Catalyst.
 Edit C<lib/MyApp.pm> and add C<Authorization::Roles> to the list:
 
     # Load plugins
-    use Catalyst qw/-Debug
+    use Catalyst qw/
+                    -Debug
                     ConfigLoader
                     Static::Simple
                 
@@ -93,19 +94,11 @@ Edit C<lib/MyApp.pm> and add C<Authorization::Roles> to the list:
                     Session::State::Cookie
                     /;
 
-B<Note:> As discussed in MoreCatalystBasics, different versions of 
-C<Catalyst::Devel> have used a variety of methods to load the plugins. 
-You can put the plugins in the C<use Catalyst> statement if you 
-prefer.
+Once again, include this additional plugin as a new dependency in 
+the Makefile.PL file like this:
 
-Once again (remain sharp, by now you should be getting the hang of things)
-include this additional plugin as a new dependency in the Makefile.PL file
-like this:
+    requires 'Catalyst::Plugin::Authorization::Roles';
 
-    requires (
-        ...
-        'Catalyst::Plugin::Authorization::Roles' => '0',
-    );
 
 =head2 Add Role-Specific Logic to the "Book List" Template
 
@@ -117,7 +110,7 @@ lines to the bottom of the file:
     
     <ul>
       [% # Dump list of roles -%]
-      [% FOR role = c.user.role %]<li>[% role %]</li>[% END %]
+      [% FOR role = c.user.roles %]<li>[% role %]</li>[% END %]
     </ul>
     
     <p>
@@ -136,7 +129,7 @@ lines to the bottom of the file:
     </p>
 
 This code displays a different combination of links depending on the
-roles assigned to the user.
+roles assigned to the user.  
 
 
 =head2 Limit Books::add to 'admin' Users
@@ -175,9 +168,9 @@ updating C<url_create> to match the following code:
     
             # Add a record to the join table for this book, mapping to
             # appropriate author
-            $book->add_to_book_author({author_id => $author_id});
+            $book->add_to_book_authors({author_id => $author_id});
             # Note: Above is a shortcut for this:
-            # $book->create_related('book_author', {author_id => $author_id});
+            # $book->create_related('book_authors', {author_id => $author_id});
     
             # Assign the Book object to the stash for display in the view
             $c->stash->{book} = $book;
@@ -305,7 +298,7 @@ match the following code:
     
         # Redirect the user back to the list page
         $c->response->redirect($c->uri_for($self->action_for('list')));
-    }    
+    }
 
 Here, we C<detach> to an error page if the user is lacking the 
 appropriate permissions.  For this to work, we need to make 
@@ -318,7 +311,7 @@ C<lib/MyApp/Controller/Root.pm> and add this method:
     
     =cut
         
-    sub error_noperms :Chained('/') :PathPath('error_noperms') :Args(0) {
+    sub error_noperms :Chained('/') :PathPart('error_noperms') :Args(0) {
         my ($self, $c) = @_;
     
         $c->stash->{template} = 'error_noperms.tt2';
@@ -355,7 +348,7 @@ Kennedy Clark, C<hkclark@gmail.com>
 
 Please report any errors, issues or suggestions to the author.  The
 most recent version of the Catalyst Tutorial can be found at
-L<http://dev.catalyst.perl.org/repos/Catalyst/Catalyst-Manual/5.70/trunk/lib/Catalyst/Manual/Tutorial/>.
+L<http://dev.catalyst.perl.org/repos/Catalyst/Catalyst-Manual/5.80/trunk/lib/Catalyst/Manual/Tutorial/>.
 
 Copyright 2006-2008, Kennedy Clark, under Creative Commons License
 (L<http://creativecommons.org/licenses/by-sa/3.0/us/>).