| 
      
      
      From: Chris W. <ch...@cw...> - 2002-03-05 14:51:38
      
     | 
| On Tue, 2002-03-05 at 02:14, Bernie Ledwick wrote:
> Chris,
> 
> I think there is another virtual host defined on port 80. I'll investigate 
> that later!
> 
> I have already changed the driver as suggested. I guess nothing would work if 
> I hadn't.
Actually, everything should still work except for creating new objects.
Thanks to DBI, the database-specific drivers don't have much code in
them at all -- mostly just the various auto-increment schemes.
> The sql output is below. 
>
> bltest=#  SELECT class, scope, scope_id, security_level
> bltest-#    FROM sys_security WHERE class like '%Handler%';
>               class              | scope | scope_id | security_level
> ---------------------------------+-------+----------+----------------
>  bltest::Handler::Package        | g     | 3        | 8
>  bltest::Handler::Error          | w     | world    | 4
> ....
> bltest=# SELECT user_id FROM sys_user WHERE login_name = 'superuser';
>  user_id
> ---------
>        1
> (1 row)
This all looks ok. So it's time for more debugging. Try running the
following script:
----------
#!/usr/bin/perl
use strict;
use OpenInteract::Startup;
my $HANDLER = 'MySite::Handler::User';
{
    my $R = OpenInteract::Startup->setup_static_environment_options(
                    undef, {}, { temp_lib => 'lazy' } );
    my $superuser_id = $R->CONFIG->{default_objects}{superuser};
    # Play with the next two lines to experiment
    my $superuser = $R->user->fetch( $superuser_id,
                                     { skip_security => 1 });
    $R->{auth}{user} = $superuser;
    $R->CONFIG->{DEBUG} = 2;
    my $level        = $R->user->check_security({
                              class                 => $HANDLER,
                              object_id             => '0' });
    print "Level: [$level]\n";
}
----------
Subtitute whatever you want for $HANDLER, and modify the user fetched or
don't fetch a user at all. See what comes up for the level and if any
helpful debugging messages pop up.
Chris
-- 
Chris Winters (ch...@cw...)
Building enterprise-capable snack solutions since 1988.
 |