Mercurial > pub > Impl
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 56:117b6956d5a5 | 57:bf59ee1cd506 |
|---|---|
| 1 package IMPL::Web::Application::Session; | |
| 2 use strict; | |
| 3 | |
| 4 use base qw(IMPL::Object); | |
| 5 | |
| 6 use IMPL::Security::Auth qw(GenSSID); | |
| 7 | |
| 8 use IMPL::Class::Property; | |
| 9 | |
| 10 BEGIN { | |
| 11 public property id => prop_get | owner_set; | |
| 12 public property principal => prop_get | owner_set; | |
| 13 public property authSession => prop_get | owner_set; | |
| 14 public property roles => prop_get | owner_set | prop_list; | |
| 15 } | |
| 16 | |
| 17 sub CTOR { | |
| 18 my ($this,%args) = @_; | |
| 19 | |
| 20 $this->principal($args{principal}) or die new IMPL::InvalidArgumentException("A principal is required"); | |
| 21 $this->authSession($args{auth}) or die new IMPL::InvalidArgumentException("An auth session is required"); | |
| 22 $this->roles($args{roles}) if $args{roles}; | |
| 23 | |
| 24 $this->id(GenSSID()); | |
| 25 } | |
| 26 | |
| 27 sub DoAuth { | |
| 28 my ($this,$secData) = @_; | |
| 29 | |
| 30 return $this->authSession->DoAuth($secData); | |
| 31 } | |
| 32 | |
| 33 sub ValidateSession { | |
| 34 my ($this,$secData) = @_; | |
| 35 | |
| 36 return $this->authSession->ValidateSession($secData); | |
| 37 } | |
| 38 | |
| 39 1; | |
| 40 | |
| 41 __END__ |
