407
|
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__ |