comparison Lib/IMPL/Security/AbstractContext.pm @ 330:fe725fad2d90

Added access checking to web resources
author sergey
date Tue, 04 Jun 2013 19:25:54 +0400
parents 2879cdb6b8cd
children
comparison
equal deleted inserted replaced
329:50ff1595bd62 330:fe725fad2d90
4 4
5 use IMPL::Const qw(:prop); 5 use IMPL::Const qw(:prop);
6 6
7 use IMPL::require { 7 use IMPL::require {
8 Role => 'IMPL::Security::Role', 8 Role => 'IMPL::Security::Role',
9 Principal => 'IMPL::Security::Principal',
9 Exception => 'IMPL::Exception', 10 Exception => 'IMPL::Exception',
10 NotImplementedException => '-IMPL::NotImplementedException' 11 NotImplementedException => '-IMPL::NotImplementedException'
11 }; 12 };
12 13
13 use parent qw(IMPL::Class::Meta); 14 use parent qw(IMPL::Class::Meta);
56 if (my $auth = $this->auth) { 57 if (my $auth = $this->auth) {
57 return $auth->isTrusted; 58 return $auth->isTrusted;
58 } else { 59 } else {
59 return 0; 60 return 0;
60 } 61 }
62 }
63
64 sub isNobody {
65 return (shift->principal == Principal->nobody ? 1 : 0);
61 } 66 }
62 67
63 sub Satisfy { 68 sub Satisfy {
64 my ($this,@roles) = @_; 69 my ($this,@roles) = @_;
65 70