Ciao,
this is what I did in order to get more info:
# in the controller
if ( ! $c->check_any_user_role( qw/Admin Manutentore/ ) ) {
$c->stash->{ message } = "User exists " . $c->user_exists() .
" - with username " . $c->user->username . " and roles "\
. $c->user->roles_to_string . " and the check is " .
$c->check_any_user_role( qw/Admin Manutentore/ );
my @roles = $c->user->users_roles->all();
@roles = map { $_->role->pk . " = " . $_->role->description }
@roles;
$c->stash->{ message } .= "Roles [@roles]";
}
and what is printed is:
User exists 1 - with username fluca1978 and roles [Manutentore] and
the check is 0Roles [12 = Manutentore]
so:
1) the user exists
2) the username is correct
3) the user has one role, the description of the role is matched
4) the check_any_user_role reports false (0)
5) the lookup of all the roles reports the right primary key and description.
Any idea about what I'm missing?
Thanks,
Luca
On Mon, Feb 9, 2015 at 9:43 PM, Luca Ferrari <[email protected]> wrote:
> Ciao,
>
> On Mon, Feb 9, 2015 at 6:12 PM, Jeff Black <[email protected]> wrote:
>>
>> Perhaps it's a stupid question, but have you checked that the user exists?
>>
>> if ( $c->user_exists() && ...
>>
>
>
> Apparently it exists because I print the username and its role list to
> check...and of course the role is there.
>
> Luca
_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/