comparison Lib/IMPL/Security/AbstractRole.pm @ 393:69a1f1508696

minor security refactoring
author cin
date Fri, 14 Feb 2014 16:41:12 +0400
parents 6d8092d8ce1b
children
comparison
equal deleted inserted replaced
392:54b1dc9e808a 393:69a1f1508696
1 package IMPL::Security::AbstractRole; 1 package IMPL::Security::AbstractRole;
2 use strict; 2 use strict;
3 3
4 use IMPL::Const qw(:prop); 4 use IMPL::Const qw(:prop);
5 5 use IMPL::lang qw(equals_s);
6 use parent qw(IMPL::Class::Meta); 6 use parent qw(IMPL::Class::Meta);
7 7
8 __PACKAGE__->static_accessor_clone( abstractProps => [ 8 __PACKAGE__->static_accessor_clone( abstractProps => [
9 roleName => PROP_RW, 9 roleName => PROP_RW,
10 parentRoles => PROP_RW | PROP_LIST 10 parentRoles => PROP_RW | PROP_LIST
18 } 18 }
19 19
20 sub _FilterRoles { 20 sub _FilterRoles {
21 my ($this,@roles) = @_; 21 my ($this,@roles) = @_;
22 22
23 @roles = grep not (ref $_ ? $this->roleName eq $_->roleName : $this->roleName eq $_), @roles; 23 @roles = grep not (ref $_ ? equals_s($this->roleName,$_->roleName) : equals_s($this->roleName, $_) ), @roles;
24 24
25 @roles = $_->_FilterRoles(@roles) or return foreach $this->parentRoles ; 25 @roles = $_->_FilterRoles(@roles) or return foreach $this->parentRoles ;
26 26
27 return @roles; 27 return @roles;
28 } 28 }