comparison lib/IMPL/Security.pm @ 407:c6e90e02dd17 ref20150831

renamed Lib->lib
author cin
date Fri, 04 Sep 2015 19:40:23 +0300
parents
children
comparison
equal deleted inserted replaced
406:f23fcb19d3c1 407:c6e90e02dd17
1 package IMPL::Security;
2 use strict;
3 use Carp qw(carp);
4
5 ##VERSION##
6
7 require IMPL::Exception;
8 require IMPL::Security::Rule::RoleCheck;
9
10 use IMPL::require {
11 Principal => 'IMPL::Security::Principal',
12 AbstractContext => 'IMPL::Security::AbstractContext',
13 Context => 'IMPL::Security::Context'
14 };
15
16 sub principal {
17 return
18 AbstractContext->current
19 && AbstractContext->current->principal
20 || Principal->nobody;
21 }
22
23 sub context {
24 AbstractContext->current || Context->nobody;
25 }
26
27 1;
28
29 __END__