comparison Lib/IMPL/Security/Role.pm @ 194:4d0e1962161c

Replaced tabs with spaces IMPL::Web::View - fixed document model, new features (control classes, document constructor parameters)
author cin
date Tue, 10 Apr 2012 20:08:29 +0400
parents d1676be8afcc
children 6d8092d8ce1b
comparison
equal deleted inserted replaced
193:8e8401c0aea4 194:4d0e1962161c
3 use parent qw(IMPL::Object); 3 use parent qw(IMPL::Object);
4 4
5 use IMPL::Class::Property; 5 use IMPL::Class::Property;
6 6
7 BEGIN { 7 BEGIN {
8 public property roleName => prop_get | owner_set; 8 public property roleName => prop_get | owner_set;
9 public property parentRoles => prop_get | owner_set | prop_list; 9 public property parentRoles => prop_get | owner_set | prop_list;
10 } 10 }
11 11
12 sub CTOR { 12 sub CTOR {
13 my ($this,$name,$parentRoles) = @_; 13 my ($this,$name,$parentRoles) = @_;
14 14
15 $this->roleName($name) if $name; 15 $this->roleName($name) if $name;
16 $this->parentRoles($parentRoles) if $parentRoles; 16 $this->parentRoles($parentRoles) if $parentRoles;
17 } 17 }
18 18
19 sub Satisfy { 19 sub Satisfy {
20 my ($this,@roles) = @_; 20 my ($this,@roles) = @_;
21 21
22 return 1 unless $this->_FilterRoles( @roles ); 22 return 1 unless $this->_FilterRoles( @roles );
23 return 0; 23 return 0;
24 } 24 }
25 25
26 sub _FilterRoles { 26 sub _FilterRoles {
27 my ($this,@roles) = @_; 27 my ($this,@roles) = @_;
28 28
29 @roles = grep not (ref $_ ? $this == $_ : $this->roleName eq $_), @roles; 29 @roles = grep not (ref $_ ? $this == $_ : $this->roleName eq $_), @roles;
30 30
31 @roles = $_->_FilterRoles(@roles) or return foreach $this->parentRoles ; 31 @roles = $_->_FilterRoles(@roles) or return foreach $this->parentRoles ;
32 32
33 return @roles; 33 return @roles;
34 } 34 }
35 35
36 36
37 1; 37 1;
38 38