X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Manual.git;a=blobdiff_plain;f=lib%2FCatalyst%2FManual%2FTutorial%2FAuthorization.pod;fp=lib%2FCatalyst%2FManual%2FTutorial%2FAuthorization.pod;h=14d62b0e2c50d55f7bcfc5fc715eecd862d35fee;hp=f889bde21e66f6cfcd57fe0c1fdffb87e8041350;hb=8a7c51514fe8828c25ecd353ad2e9dc3b456ac9a;hpb=905a3a26761669e7c4fd80daa50034eaa3375b50 diff --git a/lib/Catalyst/Manual/Tutorial/Authorization.pod b/lib/Catalyst/Manual/Tutorial/Authorization.pod index f889bde..14d62b0 100644 --- a/lib/Catalyst/Manual/Tutorial/Authorization.pod +++ b/lib/Catalyst/Manual/Tutorial/Authorization.pod @@ -74,7 +74,7 @@ In this section you learn how to manually configure authorization. Edit C and add C to the list: - use Catalyst qw/ + __PACKAGE__->setup(qw/ -Debug ConfigLoader Static::Simple @@ -87,7 +87,7 @@ Edit C and add C to the list: Session Session::Store::FastMmap Session::State::Cookie - /; + /); =head2 Add Config Information for Authorization @@ -145,25 +145,25 @@ C and C definitions are new): Open C in your editor and add the following lines to the bottom of the file: -

Hello [% Catalyst.user.username %], you have the following roles:

+

Hello [% c.user.username %], you have the following roles:

    [% # Dump list of roles -%] - [% FOR role = Catalyst.user.roles %]
  • [% role %]
  • [% END %] + [% FOR role = c.user.roles %]
  • [% role %]
  • [% END %]

[% # Add some simple role-specific logic to template %] [% # Use $c->check_user_roles() to check authz -%] - [% IF Catalyst.check_user_roles('user') %] + [% IF c.check_user_roles('user') %] [% # Give normal users a link for 'logout' %] - Logout + Logout [% END %] [% # Can also use $c->user->check_roles() to check authz -%] - [% IF Catalyst.check_user_roles('admin') %] + [% IF c.check_user_roles('admin') %] [% # Give admin users a link for 'create' %] - Create + Create [% END %]