Hello,

I am trying to write an authorization handler in mod_perl and got a 
very strange behaviour.
What I want to achieve is use the group memberships stored in a 
database that is handled by RDBO to restrict access to some parts of 
my application.

This script works perfectly well when run from the command line:
 use PVonline::Therapeuten;

 sub groups_of_user {
   return map {$_->name} PVonline::Therapeuten->new(nr=>1)->gruppen;
 }

 print groups_of_user(); 
 # prints the names of all groups, user 1 is member of

But when I do the same within a mod_perl authz handler script:
sub groups_of_user {
  # called from the handler
  my @groups = map {$_->name} PVonline::Therapeuten->new(nr=>1)->load-
>gruppen;
  warn @groups;
  # gives: use of uninitialized value in warn at ...
  return @groups;
}

gives "use of uninitialized value in warn at ..."
A similar warn that accesses a 'many to one' relationship works 
perfectly well.

I tried lots of variations but non of them worked. At one time I 
thought I was very close, when I did a 
warn PVonline::Therapeuten->new(nr=>1)->load->gruppen;
With this I got:
PVonline::Gruppen=HASH(0x356c0a8)PVonline::Gruppen=HASH(0x356c3e4) 
at...
This looks very much like the two group objects of the groups the 
user is member of. But why doesn't the 'name' method work on these 
objects?

For the record, here is the definition of the "gruppen"-method in 
PVonline::Therapeuten:
    gruppen => {
        type      => 'many to many',
        map_class => 'PVonline::Gruppenzuordnung',
        # map_from  => 'therapeut',
        # map_to    => 'gruppe',
    },

Any ideas?

Michael




-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to