diff Lib/IMPL/Web/Application/Session.pm @ 57:bf59ee1cd506

Web application main class functionality
author wizard
date Fri, 05 Mar 2010 13:59:29 +0300
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Lib/IMPL/Web/Application/Session.pm	Fri Mar 05 13:59:29 2010 +0300
@@ -0,0 +1,41 @@
+package IMPL::Web::Application::Session;
+use strict;
+
+use base qw(IMPL::Object);
+
+use IMPL::Security::Auth qw(GenSSID);
+
+use IMPL::Class::Property;
+
+BEGIN {
+	public property id => prop_get | owner_set;
+	public property principal => prop_get | owner_set;
+	public property authSession => prop_get | owner_set;
+	public property roles => prop_get | owner_set | prop_list;
+}
+
+sub CTOR {
+	my ($this,%args) = @_;
+	
+	$this->principal($args{principal}) or die new IMPL::InvalidArgumentException("A principal is required");
+	$this->authSession($args{auth}) or die new IMPL::InvalidArgumentException("An auth session is required");
+	$this->roles($args{roles}) if $args{roles};
+	
+	$this->id(GenSSID());
+}
+
+sub DoAuth {
+	my ($this,$secData) = @_;
+	
+	return $this->authSession->DoAuth($secData);
+}
+
+sub ValidateSession {
+	my ($this,$secData) = @_;
+	
+	return $this->authSession->ValidateSession($secData);
+}
+
+1;
+
+__END__
\ No newline at end of file