Grokbase
Topics Posts Groups | in
x
[ help ]

Mark Blythe (l...@markblythe.com)

Profile | Posts (33)

User Information

Display Name:Mark Blythe
Partial Email Address:l...@markblythe.com
Posts:
33 total
21 in Catalyst Framework
12 in DBIx::Class

5 Most Recent

All Posts
1) Mark Blythe [Catalyst] "no role configuration found" -- authorization: dbic and DBI::Schema::Loader
| +1 vote
While I don't use the DBIx::Class::Loader, I did notice that since the Catalyst::Plugin::Auth...
catalyst@lists.scsys.co.uk
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
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 Catalyst::Plugin::Authentication::Store::DBIx::Class liked that much
better.

This may not be the only way to solve it, but it worked for me.


On 12/15/07, Ashley Pond V <apv@sedition.com> wrote:
>
> Progressing=85 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
>          password_field: password
>          password_type: hashed
>          password_hash_type: SHA-1
>        store:
>          class: DBIx::Class
>          user_class: User
>          role_relation: user_roles
>          role_field: role
>
> --I now get the roles checked but they are failing because they are
> checking (returning) the role "id" instead of the "name."
>
> $c->user->roles returns a list of the IDs too. So, from reading this,
> Catalyst::Plugin::Authentication::Store::DBIx::Class::roles()
> it looks like dynamic loader schemas are incompatible right now? I'm
> trying to figure this out but there is a lot of inter-related code to
> read, cross-package-configuration, and documentation drift/lag.
>
> Throw me a bone, er, a line!
> -Ashley
>
>
> On Dec 15, 2007, at 10:18 AM, Ashley Pond V wrote:
> > 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, please share your
> > configuration or advise of which FMTR.
> >
> > Thanks again,
> > -Ashley
> >
>
> _______________________________________________
> List: [email protected: Cat...@lists.scsys.co.uk]
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.rawmode.org/
> Dev site: http://dev.catalyst.perl.org/
>
2) Mark Blythe [Catalyst] Input/Parameter Checks
| +1 vote
Are you sure about this one? I just tested this with DBI_TRACE, and it does appear to use bind...
catalyst@lists.scsys.co.uk
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
On 12/13/07, Jonathan Rockway <jon@jrock.us> wrote:
>
>
> Be mindful of these cases, though:
>
>   # 2
>   my $user =3D $rs->create({
>       is_admin =3D> 0,
> username =3D> $c->req->param('username'),
>   });


Are you sure about this one?  I just tested this with DBI_TRACE, and it does
appear to use bind variables when generating the INSERT statement.  I tried
tripping it up with SQL injections, tossing in quotes, semicolons, etc, and
it always handled it gracefully, as it should when properly using binds.
3) Mark Blythe [Catalyst] ANNOUNCE: New Catalyst-Powered Site: Mister Poll
| +1 vote
Hello! I'd like to announce a relaunch of my web site, Mister Poll, which is now powered by...
catalyst@lists.scsys.co.uk
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
Hello!

I'd like to announce a relaunch of my web site, Mister Poll, which is now
powered by Catalyst / DBIC:

http://www.misterpoll.com/

I've actually been running the site for 10 years now.  It started out as CGI
(of course) and has been mod_perl for many years now.  When I finally
decided to rewrite the blessed thing from the ground up, I chose Catalyst.
I'm quite glad I did.  For those who may be interested, it is now running on
Linux, MySQL 5.0, Catalyst, DBIC, lighttpd + FastCGI.

Many thanks to all of you on this list (and the DBIC list), who have either
helped me directly or indirectly through the archives.  My gratitude to
everybody who has contributed to produce this software as well.  It's a
great benefit to the Perl community.

Mark
4) Mark Blythe [Dbix-class] single field in resultset?
| +1 vote
Michael, See the 'columns' attribute or the 'select / as' attribute combo. For example:...
dbix-class@lists.scsys.co.uk
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
Michael,

See the 'columns' attribute or the 'select / as' attribute combo.  For
example:

$schema->resultset('Foo')->search(
  {  id =3D> { -in =3D> [ 1, 2, 3 ] }  },
  {  columns =3D> [ 'id', 'title' ] }
);

It's covered in more detail in the ATTRIBUTES section of the
DBIx::Class::ResultSet perldocs.  There are also some examples in
DBIx::Class::Manual::Cookbook under 'Using specific columns'.

Good luck,
Mark


On Dec 6, 2007 11:08 AM, Michael Higgins <linux@evolone.org> wrote:

> Can anyone tell me how to grab a result set that is a list of only one
> column? I see how to do %where, but not [what]..??
>
> Cheers,
>
> --
>  |\  /|        |   |          ~ ~
>  | \/ |        |---|          `|` ?
>  |    |ichael  |   |iggins    \^ /
>  michael.higgins[at]evolone[dot]org
>
> _______________________________________________
> List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
> IRC: irc.perl.org#dbix-class
> SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
> Searchable Archive:
> http://www.grokbase.com/group/dbix-class@lists.rawmode.org
>
5) Mark Blythe [Dbix-class] Related results, prefetch, paging = problem
| +1 vote
Sorry, my mistake. I missed one change in the example. You should use 'select' instead of...
dbix-class@lists.scsys.co.uk
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
Sorry, my mistake.  I missed one change in the example.  You should
use 'select' instead of 'columns'.  At least I did:

$c->stash->{routes} = $c->model('QDB::Routes')->search(
                  {
                          'me.net_id'    => $c->stash->{net_id},
                          'me.route_beg' => $c->stash->{node_id_beg},
                          'me.route_end' => $c->stash->{node_id_end},
                  },
                  {
                          join => { 'xc_params' => 'nodes' },

                          select  => [qw/
                          me.route_id me.route_beg me.route_end
me.err_code me.comment me.net_id
                          xc_params.node_rank xc_params.ch_beg xc_params.ch_end
                          nodes.node_id nodes.node_name
                          / ],

                          as  => [qw/
                          route_id route_beg route_end err_code comment net_id
                          xc_params.node_rank xc_params.ch_beg xc_params.ch_end
                          xc_params.nodes.node_id xc_params.nodes.node_name
                          / ],

                          #TODO Paged output
                          order_by => [ @order_by ],
                          page     => $page,       # page to return
(defaults to 1)
rows => $rows, # number of results per page,
                          cache => 1
                  }
          );

spacer
Profile | Posts (33)
Home > People > Mark Blythe