FAQ
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

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedDec 7, '09 at 9:45a
activeDec 7, '09 at 9:45a
posts1
users1
websitecatalystframework.org
irc#catalyst

1 user in discussion

Jens Schwarz: 1 post

People

Translate

site design / logo © 2021 Grokbase