25 Nov 2010 18:36:28 UTC
- Distribution: MooseX-AuthorizedMethods
- Source (raw)
- Browse (raw)
- How to Contribute
- Clone repository
- Issues (0)
- Testers (1793 / 7 / 26)
- KwaliteeBus factor: 0
- % Coverage
- License: perl_5
- Activity24 month
- Download (27.91KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest versionDRUOSO Daniel Ruoso
MooseX::Meta::Method::Authorized - Authorization in method calls
This trait provides support for verifying authorization before calling a method.
This attribute is an array reference with the values that are going to be used by the verifier when checking this invocation.
This is the object/class on which the "authorized_do" method is going to be invoked. This is the object responsible for doing the actual verification. It is invoked as:
$verifier->authorized_do($meth_obj, $code, @_)
It is expected that this method should die if the authorization is not stablished.
The default value for this attribute is MooseX::Meta::Method::Authorized::CheckRoles, which will get the current user by calling the "user" method and list the roles given to that user by invoking the "roles" method.
This role overrides wrap so that the actual method is only invoked after the authorization being checked.
Daniel Ruoso <email@example.com>
With help from rafl and doy from #moose.
Copyright 2010 by Daniel Ruoso et al
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Module Install Instructions
To install MooseX::AuthorizedMethods, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install MooseX::AuthorizedMethods
For more information on module installation, please visit the detailed CPAN module installation guide.