ACL-Lite
view release on metacpan - search on metacpan
view release on metacpan or search on metacpan
lib/ACL/Lite.pm view on Meta::CPAN
if (ref($permissions) eq 'ARRAY') {
@check = @$permissions;
}
else {
@check = ($permissions);
}
if ($uid && $uid ne $self->{uid}) {
# mismatch on user identifier
return;
}
$user_permissions = $self->permissions;
for my $perm (@check) {
if (exists $user_permissions->{$perm}) {
return $perm;
}
}
return;
}
=head2 permissions
Returns permissions as hash reference:
$perms = $acl->permissions;
Returns permissions as list:
@perms = $acl->permissions;
=cut
sub permissions {
my ($self) = @_;
if ($self->{volatile}) {
$self->{permissions} = $self->{sub}->();
}
if (wantarray) {
return keys %{$self->{permissions}};
}
return $self->{permissions};
}
=head1 CAVEATS
Please anticipate API changes in this early state of development.
=head1 AUTHOR
Stefan Hornburg (Racke), C<racke@linuxia.de>
=head1 BUGS
Please report any bugs or feature requests to C<bug-acl-lite at rt.cpan.org>, or through
the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=ACL-Lite>. I will be notified, and then you'll
automatically be notified of progress on your bug as I make changes.
=head1 SUPPORT
You can find documentation for this module with the perldoc command.
perldoc ACL::Lite
You can also look for information at:
=over 4
=item * RT: CPAN's request tracker (report bugs here)
L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=ACL-Lite>
=item * AnnoCPAN: Annotated CPAN documentation
L<http://annocpan.org/dist/ACL-Lite>
=item * CPAN Ratings
L<http://cpanratings.perl.org/d/ACL-Lite>
=item * Search CPAN
L<http://search.cpan.org/dist/ACL-Lite/>
=back
=head1 ACKNOWLEDGEMENTS
=head1 LICENSE AND COPYRIGHT
Copyright 2011-2013 Stefan Hornburg (Racke).
This program is free software; you can redistribute it and/or modify it
under the terms of either: the GNU General Public License as published
by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
=cut
1; # End of ACL::Lite
view all matches for this distributionview release on metacpan - search on metacpan
( run in 0.728 second using v1.00-cache-2.02-grep-82fe00e-cpan-72ae3ad1e6da )