diff Lib/IMPL/Web/Application/Action.pm @ 52:15d720913562

security in work
author wizard@linux-odin.local
date Tue, 02 Mar 2010 20:12:02 +0300 (2010-03-02)
parents
children 609b59c9f03c
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Lib/IMPL/Web/Application/Action.pm	Tue Mar 02 20:12:02 2010 +0300
@@ -0,0 +1,66 @@
+package IMPL::Web::Application::Action;
+
+use base qw(IMPL::Object);
+
+use IMPL::Class::Property;
+
+BEGIN {
+	public property application => prop_get | owner_set;
+	public property request => prop_get | owner_set;
+	public property response => prop_get | owner_set;
+	public property code => prop_get | owner_set;
+	public property chainHandlers => prop_get | owner_set | prop_list;
+}
+
+1;
+
+__END__
+
+=pod
+
+=head1 DESCRIPTION
+
+���������� ������� ���������� �������, ����������� ���������, �������������� ��������.
+
+������ ��������� ������������ ��������, ����� ��� C<IMPL::Web::Application::UriController>.
+��� ���� ����������� ������� ������������ �������, ��� ������� ����� ����������� � ���������� ������������,
+������ ������ ����������� ���������� � �������� ������ �� ���������� �������� �� ������ ������� ������,
+�� � ���������� ����������.
+
+�������� ������� ����� ���� �����, � ������� ����������
+
+$objSecCallToMethod($target,$method)
+$AuthenticateMethod
+$TDocumentOut($file)
+
+��� �������� � ��������� ������������������
+
+Action->Invoke() {
+	TDocumentOut->Invoke($Action,$nextHandler) {
+		my $result = $nextHandler() {
+			$AuthenticateMethod($Action,$nextHandler) {
+				my $context = $Action->application->security->Authenticate($Action->request,$Action->response);
+				return $context->Impersonate($nextHandler) {
+					$objSecCallToMethod->Invoke($Action,undef) {
+						IMPL::Security->AccessCheck($target,$method);
+						return $target->$method();
+					}
+				}
+			}
+		}
+		$this->format($result,$Action->response->streamBody);
+	}		
+}
+
+��� ��� ������������ ����� ���� ���
+
+$objSecCallToMethod($target,$method)
+$AuthenticateMethod
+$TransfromToSimpleData
+$JSONOut
+
+� ������ ������� ����� ���������� ����� ������, �� ��� ��������� ����� �������������
+� ������� ��������� � ���������� JSON ���������������. ����� ������� ������ ������
+�� ��������� ����� � �������� �������, ��� ������ ��������� �������������� �������.
+
+=cut
\ No newline at end of file