Mercurial > pub > Impl
view Lib/IMPL/Security/Role.pm @ 55:609b59c9f03c
Web application
rewrote prop_list implementation to support IMPL::Object::List
author | wizard |
---|---|
date | Wed, 03 Mar 2010 17:40:18 +0300 (2010-03-03) |
parents | a1498298d3ee |
children | 2f31ecabe9ea |
line wrap: on
line source
package IMPL::Security::Role; use base qw(IMPL::Object); use IMPL::Class::Property; BEGIN { public property roleName => prop_get; public property parentRoles => prop_get; } sub CTOR { my ($this,$name,$parentRoles) = @_; $this->roleName($name); $this->parentRoles($parentRoles); } sub Satisfy { my ($this,@roles) = @_; return 1 unless $this->_FilterRoles( @roles ); } sub _FilterRoles { my ($this,@roles) = @_; @roles = grep not (ref $_ ? $this == $_ : $this->roleName eq $_), @roles; @roles = $_->_FilterRoles(@roles) or return foreach @{$this->parentRoles} ; return @roles; } 1; __END__ =pod =head1 DESCRIPTION ����. ����� �������� � ���� ������� ����. ������� ����� ��� �������� ������� ����������� ����� � ������� ����. =head1 MEMBERS =over =item C<roleName> ��� ����, �� ������������� =item C<parentRoles> ������ ������������ ����� =item C<Satisfy(@roles_list)> ��������� ������� ����� ��������� ����� �� ������ @roles_list. ����������� ������������� ��� ����� ��������, ��� � ���� �����. ���������� 0 � ������ �������, 1 ��� ������� ����������� ����� =back =cut