diff Lib/IMPL/Web/Application/Action.pm @ 340:c090d9102a38

web application security refactoring
author cin
date Fri, 21 Jun 2013 02:43:56 +0400
parents 97628101b765
children ec58c47edb52
line wrap: on
line diff
--- a/Lib/IMPL/Web/Application/Action.pm	Wed Jun 19 03:25:44 2013 +0400
+++ b/Lib/IMPL/Web/Application/Action.pm	Fri Jun 21 02:43:56 2013 +0400
@@ -19,6 +19,7 @@
     ],
     props => [
         application => PROP_RW,
+        security => PROP_RW,
         query => PROP_RO,
         context => PROP_RW,
         _jsonData => PROP_RW,
@@ -29,6 +30,8 @@
     my ($this) = @_;
     
     $this->context({});
+    $this->security($this->application->security->new())
+        if $this->application->security;
 }
 
 sub cookie {
@@ -173,6 +176,9 @@
 sub Dispose {
     my ($this) = @_;
     
+    $this->security->Dispose()
+        if $this->security and $this->security->can('Dispose');
+    
     $_->Dispose() foreach grep is($_,Disposable), values %{$this->context}; 
     
     $this->next::method();