annotate Lib/IMPL/Security.pm @ 59:0f3e369553bd

Rewritten property implementation (probably become slower but more flexible) Configuration infrastructure in progress (in the aspect of the lazy activation) Initial concept for the code generator
author wizard
date Tue, 09 Mar 2010 02:50:45 +0300
parents a1498298d3ee
children f47f93534005
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
1 package IMPL::Security;
51
a1498298d3ee Security in progress
wizard@linux-odin.local
parents: 50
diff changeset
2 require IMPL::Security::Context;
a1498298d3ee Security in progress
wizard@linux-odin.local
parents: 50
diff changeset
3 require IMPL::Security::Rule::RoleCheck;
a1498298d3ee Security in progress
wizard@linux-odin.local
parents: 50
diff changeset
4
a1498298d3ee Security in progress
wizard@linux-odin.local
parents: 50
diff changeset
5 our @rules = (
a1498298d3ee Security in progress
wizard@linux-odin.local
parents: 50
diff changeset
6 \&IMPL::Security::Rule::RoleCheck::SatisfyAll
a1498298d3ee Security in progress
wizard@linux-odin.local
parents: 50
diff changeset
7 );
a1498298d3ee Security in progress
wizard@linux-odin.local
parents: 50
diff changeset
8
a1498298d3ee Security in progress
wizard@linux-odin.local
parents: 50
diff changeset
9 sub AccessCheck {
a1498298d3ee Security in progress
wizard@linux-odin.local
parents: 50
diff changeset
10 my ($self, $object, $desiredAccess, $context) = @_;
a1498298d3ee Security in progress
wizard@linux-odin.local
parents: 50
diff changeset
11
a1498298d3ee Security in progress
wizard@linux-odin.local
parents: 50
diff changeset
12 $context = IMPL::Security::Context->contextCurrent;
a1498298d3ee Security in progress
wizard@linux-odin.local
parents: 50
diff changeset
13
a1498298d3ee Security in progress
wizard@linux-odin.local
parents: 50
diff changeset
14 $_->() or return 0 foreach @{$self->Rules};
a1498298d3ee Security in progress
wizard@linux-odin.local
parents: 50
diff changeset
15
a1498298d3ee Security in progress
wizard@linux-odin.local
parents: 50
diff changeset
16 return 1;
a1498298d3ee Security in progress
wizard@linux-odin.local
parents: 50
diff changeset
17 }
a1498298d3ee Security in progress
wizard@linux-odin.local
parents: 50
diff changeset
18
a1498298d3ee Security in progress
wizard@linux-odin.local
parents: 50
diff changeset
19 sub Rules {
a1498298d3ee Security in progress
wizard@linux-odin.local
parents: 50
diff changeset
20 return \@rules;
a1498298d3ee Security in progress
wizard@linux-odin.local
parents: 50
diff changeset
21 }
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
22
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
23 1;
50
wizard@linux-odin.local
parents: 49
diff changeset
24
wizard@linux-odin.local
parents: 49
diff changeset
25 __END__
wizard@linux-odin.local
parents: 49
diff changeset
26
wizard@linux-odin.local
parents: 49
diff changeset
27 =pod
wizard@linux-odin.local
parents: 49
diff changeset
28
wizard@linux-odin.local
parents: 49
diff changeset
29 =head1 DESCRIPTION
wizard@linux-odin.local
parents: 49
diff changeset
30
51
a1498298d3ee Security in progress
wizard@linux-odin.local
parents: 50
diff changeset
31 Модуль для инфраструктуры безопасности, реализует основные функции для авторизации
a1498298d3ee Security in progress
wizard@linux-odin.local
parents: 50
diff changeset
32 и аутентификации пользователей.
a1498298d3ee Security in progress
wizard@linux-odin.local
parents: 50
diff changeset
33
a1498298d3ee Security in progress
wizard@linux-odin.local
parents: 50
diff changeset
34 Модуль аутентификации, реализиция которого зависит от приложения, аутентифицирует
a1498298d3ee Security in progress
wizard@linux-odin.local
parents: 50
diff changeset
35 пользователя, при этом создается контекст безопасности, который содержит
a1498298d3ee Security in progress
wizard@linux-odin.local
parents: 50
diff changeset
36 идентификатор пользователя и список активных ролей.
a1498298d3ee Security in progress
wizard@linux-odin.local
parents: 50
diff changeset
37
a1498298d3ee Security in progress
wizard@linux-odin.local
parents: 50
diff changeset
38 При проверке прав доступа происходит последовательная проверка правил доступа,
a1498298d3ee Security in progress
wizard@linux-odin.local
parents: 50
diff changeset
39 если все правила выполнены, то доступ разрешается.
a1498298d3ee Security in progress
wizard@linux-odin.local
parents: 50
diff changeset
40
50
wizard@linux-odin.local
parents: 49
diff changeset
41
wizard@linux-odin.local
parents: 49
diff changeset
42
wizard@linux-odin.local
parents: 49
diff changeset
43 =cut