Mercurial > pub > Impl
annotate Lib/IMPL/Security/Role.pm @ 171:59e5fcb59d86
Исправления, изменена концепция веб-форм
author | sourcer |
---|---|
date | Mon, 06 Jun 2011 03:30:36 +0400 |
parents | 4267a2ac3d46 |
children | 068acfe903c3 |
rev | line source |
---|---|
51 | 1 package IMPL::Security::Role; |
2 | |
166 | 3 use parent qw(IMPL::Object); |
51 | 4 |
5 use IMPL::Class::Property; | |
6 | |
7 BEGIN { | |
73 | 8 public property roleName => prop_get | owner_set; |
9 public property parentRoles => prop_get | owner_set | prop_list; | |
51 | 10 } |
11 | |
12 sub CTOR { | |
13 my ($this,$name,$parentRoles) = @_; | |
14 | |
144
b56ebc31bf18
Empty nodes no more created while transforming a post request to the DOM document
wizard
parents:
94
diff
changeset
|
15 $this->roleName($name) if $name; |
b56ebc31bf18
Empty nodes no more created while transforming a post request to the DOM document
wizard
parents:
94
diff
changeset
|
16 $this->parentRoles($parentRoles) if $parentRoles; |
51 | 17 } |
18 | |
19 sub Satisfy { | |
20 my ($this,@roles) = @_; | |
21 | |
22 return 1 unless $this->_FilterRoles( @roles ); | |
94 | 23 return 0; |
51 | 24 } |
25 | |
26 sub _FilterRoles { | |
27 my ($this,@roles) = @_; | |
28 | |
29 @roles = grep not (ref $_ ? $this == $_ : $this->roleName eq $_), @roles; | |
30 | |
94 | 31 @roles = $_->_FilterRoles(@roles) or return foreach $this->parentRoles ; |
51 | 32 |
33 return @roles; | |
34 } | |
35 | |
36 | |
37 1; | |
38 | |
39 __END__ | |
40 | |
41 =pod | |
42 | |
73 | 43 =head1 NAME |
44 | |
45 C<IMPL::Security::Role> | |
46 | |
51 | 47 =head1 DESCRIPTION |
48 | |
73 | 49 . |
51 | 50 . |
51 | |
52 =head1 MEMBERS | |
53 | |
54 =over | |
55 | |
73 | 56 =item C<[get] roleName> |
51 | 57 |
58 , | |
59 | |
73 | 60 =item C<[get,list] parentRoles> |
51 | 61 |
62 | |
63 | |
64 =item C<Satisfy(@roles_list)> | |
65 | |
66 @roles_list. | |
67 , . | |
68 0 , 1 | |
69 | |
70 =back | |
71 | |
72 =cut |