comparison Lib/IMPL/Security/Context.pm @ 51:a1498298d3ee

Security in progress
author wizard@linux-odin.local
date Mon, 01 Mar 2010 17:25:36 +0300
parents 16ada169ca75
children f47f93534005
comparison
equal deleted inserted replaced
50:521c9c1a3ea1 51:a1498298d3ee
6 6
7 use IMPL::Class::Property; 7 use IMPL::Class::Property;
8 8
9 require IMPL::Security::Principal; 9 require IMPL::Security::Principal;
10 10
11 my $current = __PACKAGE__->nobody; 11 my $current;
12 my $nobody; 12 my $nobody;
13 13
14 BEGIN { 14 BEGIN {
15 public property Principal => prop_get; 15 public property Principal => prop_get;
16 public property AssignedRoles => prop_all; 16 public property AssignedRoles => prop_all;
17 public property AuthSession => prop_all;
17 } 18 }
18 19
19 sub Impersonate { 20 sub Impersonate {
20 my ($this,$code) = @_; 21 my ($this,$code) = @_;
21 22
31 } else { 32 } else {
32 return $result; 33 return $result;
33 } 34 }
34 } 35 }
35 36
36 sub nobody { 37 sub contextNobody {
37 my ($self) = @_; 38 my ($self) = @_;
38 $nobody = $self->new(Principal => IMPL::Security::Principal->nobody, AssignedRoles => undef) unless $nobody; 39 $nobody = $self->new(Principal => IMPL::Security::Principal->nobody, AssignedRoles => undef) unless $nobody;
39 $nobody; 40 $nobody;
40 } 41 }
41 42
43 sub contextCurrent {
44 my ($self) = @_;
45
46 $current = __PACKAGE__->nobody unless $current;
47 $current;
48 }
49
42 1; 50 1;