[Catalyst] catalyst tutorial sample question about authorization

Albert Lee hanzhupeng at gmail.com
Wed Apr 2 13:26:37 BST 2008


I'm reading the tutorial chapter 5 : Authorization

I add some like this :

[% IF Catalyst.check_user_roles('user') %]
  <a href="[% Catalyst.uri_for('/logout') %]">Logout</a>
[% END %]


[% IF Catalyst.check_user_roles('admin') %]
  <a href="[% Catalyst.uri_for('form_create') %]">Create</a>
[% END %]

and then login in a user who has "user" role but no "admin" role, it
shows some error on browser:

Here's the error message, on the off-chance that it means something to
you: undef error - check_user_roles is undefined.


---- if I use another user (admin & user role) to login, it's ok.

why?



More information about the Catalyst mailing list