Scheduler, switch to Set::Scalar
[catagits/Catalyst-Plugin-Scheduler.git] / lib / Catalyst / Plugin / Scheduler.pm
index 535d761..6f92935 100644 (file)
@@ -8,7 +8,7 @@ use DateTime::Event::Cron;
 use DateTime::TimeZone;
 use File::stat;
 use NEXT;
-use Set::Object;
+use Set::Scalar;
 use Storable qw/lock_store lock_retrieve/;
 use YAML;
 
@@ -222,11 +222,8 @@ sub _event_authorized {
 
     my $hosts_allow = $c->config->{scheduler}->{hosts_allow};
     $hosts_allow = [$hosts_allow] unless ref($hosts_allow) eq 'ARRAY';
-
-    my $ip      = Set::Object->new( [ $c->req->address ] );
-    my $allowed = Set::Object->new( $hosts_allow );
-
-    return $ip->subset($allowed);
+    my $allowed = Set::Scalar->new( @{$hosts_allow} );
+    return $allowed->contains( $c->req->address );
 }
 
 # get the state from the state file