X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FManual%2FTutorial%2FAuthorization.pod;h=f35deb8e479409cd6d4671d13270a99ec99ee71d;hb=e13f83ccef7d53d2bcb8d2f2f459bbd2e6f3474e;hp=5f4e4efc186d03041a5bbc95659a07a0f62850ca;hpb=3533daff0314522f79dff9c618da087568f1378c;p=catagits%2FCatalyst-Manual.git diff --git a/lib/Catalyst/Manual/Tutorial/Authorization.pod b/lib/Catalyst/Manual/Tutorial/Authorization.pod index 5f4e4ef..f35deb8 100644 --- a/lib/Catalyst/Manual/Tutorial/Authorization.pod +++ b/lib/Catalyst/Manual/Tutorial/Authorization.pod @@ -92,47 +92,51 @@ Edit C and add C to the list: =head2 Add Config Information for Authorization -Edit C and update it to match the following (the +Edit C and update it to match the following (the C and C definitions are new): --- - name: MyApp - authentication: - default_realm: dbic - realms: - dbic: - credential: + name MyApp + + default_realm dbic + + + # Note this first definition would be the same as setting # __PACKAGE__->config->{authentication}->{realms}->{dbic} # ->{credential} = 'Password' in lib/MyApp.pm - # (IOW, each hash key becomes a "name:" in the YAML file). # # Specify that we are going to do password-based auth - class: Password + class Password # This is the name of the field in the users table with the # password stored in it - password_field: password + password_field password # We are using an unencrypted password now - password_type: clear - store: + password_type clear + + # Use DBIC to retrieve username, password & role information - class: DBIx::Class + class DBIx::Class # This is the model object created by Catalyst::Model::DBIC # from your schema (you created 'MyAppDB::User' but as the # Catalyst startup debug messages show, it was loaded as # 'MyApp::Model::MyAppDB::Users'). # NOTE: Omit 'MyApp::Model' here just as you would when using # '$c->model("MyAppDB::Users)' - user_class: MyAppDB::Users + user_class MyAppDB::Users # This is the name of the field in your 'users' table that # contains the user's name - id_field: username + id_field username # This is the name of a many_to_many relation in the users # object that points to the roles for that user - role_relation: roles + role_relation roles # This is the name of field in the roles table that contains # the role information - role_field: role + role_field role + + + + =head2 Add Role-Specific Logic to the "Book List" Template