1 package DX::ActionPolicy::LockScope;
5 with 'DX::Role::ActionPolicy';
7 has lock_to_depth => (is => 'ro', required => 1, isa => Int);
9 has next_policy => (is => 'ro', required => 1, isa => ActionPolicy);
12 my ($self, $action) = @_;
13 my $first = $action->target_path->[0];
14 return 0 unless $first =~ /^(\d+)$/ and $first > $self->lock_to_depth;
15 return $self->next_policy->allows($action);