Subject: | Possible error in Catalyst::Manual::Tutorial re: roles |
http://search.cpan.org/~hkclark/Catalyst-Manual-5.8000/lib/Catalyst/Manual/Tutorial/05_Authentication.pod#Add_Users_and_Roles_to_the_Database
tells you to create a user_roles tables with ('user_id', 'role_id').
http://search.cpan.org/~hkclark/Catalyst-Manual-5.8000/lib/Catalyst/Manual/Tutorial/06_Authorization.pod#Add_Role-Specific_Logic_to_the_"Book_List"_Template
shows you a quick way to dump out those roles.
However, it fails with this error message:
[error] Couldn't render template "undef error -
Reactant::Schema::Result::User::roles(): search_related: result source
'UserRole' has no such relationship role at
/usr/local/share/perl/5.10.0/Catalyst/Authentication/Store/DBIx/Class/User.pm
line 136
I fixed this in my app by changing user_roles to be ('user','role').
I'm not sure whether this is the correct solution, or whether the
template should be constructed differently instead, or indeed whether
the problem was introduced by my other code (I'm not following the
tutorial exactly, but I think I was close to literal on this section).
Feel free to grab me on irc ('denny') or email me if this doesn't make
sense, I'll try to explain further.
Regards,
Denny