Add group privilege checking to the Shipping Drivers

This commit is contained in:
Colin Kuskie 2009-06-18 23:24:33 +00:00
parent 0a004d72a0
commit a85924d07b
9 changed files with 166 additions and 20 deletions

View file

@ -104,6 +104,7 @@ sub getOptions {
$self->session->log->warn($e->error);
next SHIPPER;
}
next SHIPPER unless $shipper->canUse;
$options{$shipper->getId} = {
label => $shipper->get("label"),
price => $price,
@ -151,8 +152,10 @@ sub getShippers {
my @drivers = ();
my $sth = $self->session->db->prepare('select shipperId from shipper');
$sth->execute();
while (my $driver = $sth->hashRef()) {
push @drivers, $self->getShipper($driver->{shipperId});
SHIPPER: while (my $driver = $sth->hashRef()) {
my $shipper = $self->getShipper($driver->{shipperId});
next SHIPPER unless $shipper->canUse;
push @drivers, $shipper;
}
$sth->finish;
return \@drivers;