[Catalyst] C::P::Authorization::Roles methods: $user parameter?

Jens Schwarz blacky6767 at gmx.de
Mon Dec 7 09:45:45 GMT 2009


Hi,

i have looked into C::P::Authorization::Roles [1] and have a question regarding the (optional) parameter $user of its methods:

Say I am logged in as user 'foo' and want to check whether user 'bar' has the role 'baz'.

The C::P::A::R help talks about the method "check_user_roles [ $user ], @roles". How does $user have to look like?

This way ...

check_user_roles('bar',qw/baz/);
?

Or that way ...

my $user = $c->model('MyApp::User')->search({username => 'bar'});
check_user_roles($user,qw/baz/);
?

It does not seem to work: Either way there is no return value (although check_user_roles should return 1 in this particular example).

Thanks for help
Jens

[1] http://search.cpan.org/perldoc?Catalyst::Plugin::Authorization::Roles
-- 
Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5 -
sicherer, schneller und einfacher! http://portal.gmx.net/de/go/atbrowser



More information about the Catalyst mailing list