[Catalyst] question about authorization and roles

Jeffrey Black jblackx-perl at yahoo.com
Mon Feb 9 17:24:13 GMT 2015


Luca,
 
Perhaps it's a stupid question, but have you checked that the user exists?
 
if ( $c->user_exists() && ...
jb
 

     On Monday, February 9, 2015 7:53 AM, Luca Ferrari <fluca1978 at infinito.it> wrote:
   

 Hi all,
I'm trying to setup the authorization in an application, and therefore
in my controller method I've something like the following:

if ( ! $c->check_any_user_role( qw/Admin Manutentore/ ) ){ .... }

and the above is always failing. At first I thought I was missing
something with the role configuration, but in my application I also
use ACLS that to the same path are configured as follows (and do
work):

if ( ! $c->check_any_user_role( qw/Admin Manutentore/ ) )

The configuration of the application is as follows:


__PACKAGE__->config('Plugin::
Authentication' => {
    default_realm => 'members',
    realms => {
        members => {
            credential => {
                class => 'Password',
                password_field => 'password',
                password_type => 'clear'
            },
                    store => {
                        class => 'DBIx::Class',
                        user_model => 'SmicketsDB::User',
                        role_relation => 'roles',
                        role_field => 'description',
                }
        }
    }
                    });


Any idea about?

Thanks,
Luca

_______________________________________________
List: Catalyst at lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scsys.co.uk/pipermail/catalyst/attachments/20150209/fd26928b/attachment.htm>


More information about the Catalyst mailing list