I backed up to a simple test script, got easier to find errors, and
found the trouble with what I was doing.
__PACKAGE__->many_to_many(roles => 'user_roles', 'name');
needed to be
__PACKAGE__->many_to_many(roles => 'user_roles', 'role');
and a corresponding many_to_many in Role.pm
__PACKAGE
Thanks for still looking at this, Jay. This is the top of the method
with some "die" decoration:
Take 1:
my ( $self, $c ) = @_;
die "This will die";
$c->assert_user_roles("no such role");
Take 2:
my ( $self, $c ) = @_;
$c->assert_user_roles("no such role");
die "This wi
Hi Ashley,
The log message you see is a result of the recent move away from the
Catalyst::Plugin::Authentication namespace for stores / credentials.
It falls back to the old naming and warns if it can't find the new
module.. It should, however, have no effect on the functionality of
the c
Continuing saga. So I set up the many_to_many and lo! It worked. But
it worked with *any* role, even fake ones, so obviously something was
bad. Turned out that it was silently failing instead of throwing an
access exception (but there was a template set by the namespace so
the page rendered
Thanks Jay! That's in line with the more recent documents (and sort
of what I was hoping to avoid). Right now my schema is nothing but a
Schema::Loader base class but I'll set it up to do a dump_to_dir
probably so I can add the many_to_many in User.pm and leave
everything else alone.
On D
Hi There Ashley,
The DBIx::Class module expects to use the relation provided in the
role_relation config element to retrieve one or more rows, which must
contain a field called by whatever you provide in role_field.
My guess is that your user_roles table is a cross-ref table - userid
and
While I don't use the DBIx::Class::Loader, I did notice that since the
Catalyst::Plugin::Auth refactor, that set of modules doesn't like dealing
with role_id's any longer. I ended up creating a database view (and
corresponding DBIC class) that spits out role names rather than role IDs,
and Catalys
Progressing… Looking at Catalyst/Plugin/Authentication/Store/DBIC/
User.pm I saw a couple of items in the "authentication" config I
could set. With "role_relation" and "role_field" set--
authentication:
default_realm: users
realms:
users:
credential:
class: Password
Can you elaborate? "map_user_role" ne "user_role." I have "role_rel"
set to the UserRole class. I tried adding "user_role" but it didn't
help and I don't see it anywhere in the docs.
I should rephrase, I think. Is anyone using DBIC::Schema::Loader
dynamically with role authorization? If so,
Ashley Pond V ha scritto:
I have no "map_user_role" b/c it's dynamic Schema::Loader. Do I have
to have it?
Yes, you have to set user_role relation in config.
Bye, \fer
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.c
10 matches
Mail list logo