diff options
author | wreis <wreis@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7> | 2009-07-30 21:13:22 +0000 |
---|---|---|
committer | wreis <wreis@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7> | 2009-07-30 21:13:22 +0000 |
commit | 565a1fc7fe67c721f2766bdc3f55c5fcb33fc760 (patch) | |
tree | 848575ca22a41f4356b06fa03858dd434ed3f7be | |
parent | 75f92cee72f95526565e9edeb905518377f31476 (diff) | |
download | reaction-565a1fc7fe67c721f2766bdc3f55c5fcb33fc760.tar.gz reaction-565a1fc7fe67c721f2766bdc3f55c5fcb33fc760.zip |
added action_filter
-rw-r--r-- | lib/Reaction/UI/ViewPort/Role/Actions.pm | 10 |
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 { |