comparison Lib/IMPL/Web/Security.pm @ 79:2d1c3f713280

ORM concept in development
author wizard
date Mon, 05 Apr 2010 00:20:34 +0400
parents 2f31ecabe9ea
children 077357224bec
comparison
equal deleted inserted replaced
78:a5cb84374d40 79:2d1c3f713280
5 use IMPL::Class::Property; 5 use IMPL::Class::Property;
6 6
7 __PACKAGE__->PassThroughArgs; 7 __PACKAGE__->PassThroughArgs;
8 8
9 BEGIN { 9 BEGIN {
10 public property sessionFactory => prop_get | owner_set; 10 public property source => prop_all;
11 public property userFactory => prop_get | owner_set;
12 } 11 }
13 12
14 sub CTOR { 13 sub CTOR {
15 my ($this) = @_; 14 my ($this) = @_;
16 15
17 $this->dataSource or die new IMPL::InvalidArgumentException("The argument is required",'dataSource'); 16 $this->dataSource or die new IMPL::InvalidArgumentException("The argument is required",'dataSource');
18 } 17 }
19 18
20 sub Session { 19 sub RetrSession {
21 my ($this,%args) = @_; 20 my ($this,$sid) = @_;
21
22 return $this->source->RetrSession(id => $sid);
22 } 23 }
23 24
24 sub User { 25 sub RetrSecData {
26 my ($this,$user,$secPackage) = @_;
25 27
28 $user = ref $user ? $user->name : $user;
29
30 return
31 $this->source->RetrSecData(user => $user, package => $secPackage);
26 } 32 }
27 33
28 1; 34 1;
29 35
30 __END__ 36 __END__