Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Catalyst: Users

configuring plugin's

 

 

Catalyst users RSS feed   Index | Next | Previous | View Threaded


paikkos at googlemail

Jun 30, 2008, 11:33 AM

Post #1 of 3 (406 views)
Permalink
configuring plugin's

Hi,

I seem to be struggling with the configuring of plugins, in this case
Authorization::Roles.

I have the following in lib/MyApp.pm

__PACKAGE__->setup(qw/-Debug
ConfigLoader
Static::Simple
StackTrace
Authentication
Authorization::Roles
Session::State
Session::Store
Session::Store::FastMmap
Session
/);

and MyApp.yml has

name: MyApp
Model::MyAppDB:
connect_info:
- DBI:SQLite:__HOME__/MyApp.db
Authentication:
default_realm: user
realms:
user:
credential:
class: Password
password_field: password
password_type: clear
store:
class: DBIx::Class
user_class: UsersRoles
role_relation: role_id
role_field: role

I think that all the above is correctly configured. The grapping void
in my understanding is making the schema available in my methods. So

sub list : Local {
my ($self, $c) = @_;
print STDERR "login=",$c->check_roles('admin'),"\n";
$c->detach('denied') unless $c->check_roles('admin');
$c->stash->{stuff} = [$c->model('MyAppDB::Stuff')->all];
$c->stash->{template} = 'submissions/list.tt2
}

Give me the error:

Can't locate object method "asser_user_roles" via package "MyApp

because I can't figure out how to use Authorization::Roles within my
class methods.

use base qw(Catalyst::Controller::HTML::FormFu
Catalyst::Plugin::Authorization::Roles
);

The above doesn't work and I would have thought that I wouldn't need
to include with a use base when it's loaded via MyApp.pm.

Any clues? TIA.
Dp.

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


Byron.Young at riverbed

Jun 30, 2008, 12:43 PM

Post #2 of 3 (385 views)
Permalink
RE: configuring plugin's [In reply to]

Dermot wrote on 2008-06-30:
> Hi,
>
> I seem to be struggling with the configuring of plugins, in this case
> Authorization::Roles.
>
> I have the following in lib/MyApp.pm
>
> __PACKAGE__->setup(qw/-Debug
> ConfigLoader
> Static::Simple
> StackTrace
> Authentication
> Authorization::Roles
> Session::State
> Session::Store
> Session::Store::FastMmap
> Session
> /);
>
> and MyApp.yml has
>
> name: MyApp
> Model::MyAppDB:
> connect_info:
> - DBI:SQLite:__HOME__/MyApp.db
> Authentication:
> default_realm: user
> realms:
> user:
> credential:
> class: Password password_field: password password_type: clear store:
> class: DBIx::Class user_class: UsersRoles role_relation: role_id
> role_field: role
> I think that all the above is correctly configured. The grapping void
> in my understanding is making the schema available in my methods. So
>
> sub list : Local {
> my ($self, $c) = @_;
> print STDERR "login=",$c->check_roles('admin'),"\n";
> $c->detach('denied') unless $c->check_roles('admin');
> $c->stash->{stuff} = [$c->model('MyAppDB::Stuff')->all];
> $c->stash->{template} = 'submissions/list.tt2
> }
>
> Give me the error:
>
> Can't locate object method "asser_user_roles" via package "MyApp
>

Looks like you have a typo somewhere. Should be 'assert_user_roles', maybe?

byron


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


paikkos at googlemail

Jul 1, 2008, 5:04 AM

Post #3 of 3 (375 views)
Permalink
Re: configuring plugin's [In reply to]

2008/6/30 Byron Young <Byron.Young [at] riverbed>:
>
> Dermot wrote on 2008-06-30:
>> Hi,
>>

>
> Looks like you have a typo somewhere. Should be 'assert_user_roles', maybe?
>
> byron

Thanx Byron. I think I should been more thorough before i emailed.
Dp.

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

Catalyst users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.