This chapter of the tutorial is divided into two main sections: 1)
basic, cleartext authentication and 2) hash-based authentication.
-You can checkout the source code for this example from the catalyst
-subversion repository as per the instructions in
+Source code for the tutorial in included in the F</home/catalyst/Final> directory
+of the Tutorial Virtual machine (one subdirectory per chapter). There
+are also instructions for downloading the code in
L<Catalyst::Manual::Tutorial::01_Intro>.
$ script/myapp_create.pl model DB DBIC::Schema MyApp::Schema \
create=static components=TimeStamp dbi:SQLite:myapp.db \
on_connect_do="PRAGMA foreign_keys = ON"
- exists "/root/dev/MyApp/script/../lib/MyApp/Model"
- exists "/root/dev/MyApp/script/../t"
- Dumping manual schema for MyApp::Schema to directory /root/dev/MyApp/script/../lib ...
+ exists "/home/catalyst/dev/MyApp/script/../lib/MyApp/Model"
+ exists "/home/catalyst/dev/MyApp/script/../t"
+ Dumping manual schema for MyApp::Schema to directory /home/catalyst/dev/MyApp/script/../lib ...
Schema dump completed.
- exists "/root/dev/MyApp/script/../lib/MyApp/Model/DB.pm"
+ exists "/home/catalyst/dev/MyApp/script/../lib/MyApp/Model/DB.pm"
$
$ ls lib/MyApp/Schema/Result
Author.pm BookAuthor.pm Book.pm Role.pm User.pm UserRole.pm
# 2) Name of has_many() relationship this many_to_many() is shortcut for
# 3) Name of belongs_to() relationship in model class of has_many() above
# You must already have the has_many() defined to use a many_to_many().
- __PACKAGE__->many_to_many(roles => 'user_roles', 'role_id');
+ __PACKAGE__->many_to_many(roles => 'user_roles', 'role');
The code for this update is obviously very similar to the edits we made
to the C<Book> and C<Author> classes created in
configurations.
B<NOTE:> Because we are using
-L<SimpleDB|L<Catalyst::Authentication::Realm::SimpleDB> along with a
+L<SimpleDB|Catalyst::Authentication::Realm::SimpleDB> along with a
database layout that complies with its default assumptions: we don't
need to specify the names of the columns where our username and password
information is stored (hence, the "Simple" part of "SimpleDB"). That
$ DBIC_TRACE=1 perl -Ilib set_hashed_passwords.pl
-We had to use the C<-Ilib> argument to tell perl to look under the
+We had to use the C<-Ilib> argument to tell Perl to look under the
C<lib> directory for our C<MyApp::Schema> model.
The DBIC_TRACE output should show that the update worked:
);
The use of C<self_check> will cause
-Catalyst::Plugin::Authentication::Store::DBIC to call the
+Catalyst::Plugin::Authentication::Store::DBIx::Class to call the
C<check_password> method we enabled on our C<password> columns.
ConfigLoader
Static::Simple
+ StackTrace
+
Authentication
Session
messages in sync with the users actions).
+You can jump to the next chapter of the tutorial here:
+L<Authorization|Catalyst::Manual::Tutorial::06_Authorization>
+
+
=head1 AUTHOR
Kennedy Clark, C<hkclark@gmail.com>
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
-<https://rt.cpan.org/Public/Dist/Display.html?Name=Catalyst-Manual>.
-
-The most recent version of the Catalyst Tutorial can be found at
-L<http://dev.catalyst.perl.org/repos/Catalyst/Catalyst-Manual/5.80/trunk/lib/Catalyst/Manual/Tutorial/>.
+L<https://rt.cpan.org/Public/Dist/Display.html?Name=Catalyst-Manual>.
-Copyright 2006-2010, Kennedy Clark, under the
+Copyright 2006-2011, Kennedy Clark, under the
Creative Commons Attribution Share-Alike License Version 3.0
(L<http://creativecommons.org/licenses/by-sa/3.0/us/>).