aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/Reaction/UI/ViewPort/Role/Actions.pm10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/Reaction/UI/ViewPort/Role/Actions.pm b/lib/Reaction/UI/ViewPort/Role/Actions.pm
index 6f3cd6a..e78ba4d 100644
--- a/lib/Reaction/UI/ViewPort/Role/Actions.pm
+++ b/lib/Reaction/UI/ViewPort/Role/Actions.pm
@@ -16,6 +16,14 @@ has action_order => (
isa => 'ArrayRef'
);
+has action_filter => (
+ isa => 'CodeRef', is => 'ro',
+ required => '1', lazy => '1',
+ default => sub {
+ sub { return [keys %{ shift->action_prototypes }] }
+ }
+);
+
has action_prototypes => (
is => 'ro',
isa => 'HashRef',
@@ -35,7 +43,7 @@ sub _build_computed_action_order {
($self->has_action_order ? $self->action_order : []),
[ keys %{ $self->action_prototypes } ]
);
- return $ordered ;
+ return $self->action_filter->($ordered, $self->model);
}
sub _build_actions {