Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

moosex::transactionalmethods(3) [mojave man page]

MooseX::TransactionalMethods(3) 			User Contributed Perl Documentation			   MooseX::TransactionalMethods(3)

NAME
MooseX::TransactionalMethods - Syntax sugar for transactional methods SYNOPSIS
package Foo::Bar; use MooseX::TransactionalMethods; # includes Moose has schema => (is => 'ro'); transactional foo => sub { # this is going to happen inside a transaction }; DESCRIPTION
This method exports the "transactional" declarator that will enclose the method in a txn_do call. DECLARATOR
transactional $name => $code When you declare with only the name and the coderef, the wrapper will call 'schema' on your class to fetch the schema object on which it will call txn_do to enclose your coderef. transactional $name => $schema, $code When you declare sending the schema object, it will store it in the method metaclass and use it directly without any calls to this object. NOTE THAT MIXING DECLARTIONS WITH SCHEMA AND WITHOUT SCHEMA WILL LEAD TO PAINFULL CONFUSION SINCE THE WRAPPING IS SPECIFIC TO THAT CLASS AND THE BEHAVIOR IS NOT MODIFIED WHEN YOU OVERRIDE THE METHOD. PREFER USING THE DYNAMIC DECLARATOR WHEN POSSIBLE. AUTHORS
Daniel Ruoso <daniel@ruoso.com> With help from rafl and doy from #moose. COPYRIGHT AND LICENSE
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. perl v5.18.2 2010-11-29 MooseX::TransactionalMethods(3)

Check Out this Related Man Page

MooseX::AuthorizedMethods(3)				User Contributed Perl Documentation			      MooseX::AuthorizedMethods(3)

NAME
MooseX::AuthorizedMethods - Syntax sugar for authorized methods SYNOPSIS
package Foo::Bar; use MooseX::AuthorizedMethods; # includes Moose has user => (is => 'ro'); authorized foo => ['foo'], sub { # this is going to happen only if the user has the 'foo' role }; DESCRIPTION
This method exports the "authorized" declarator that makes a verification if the user has the required permissions before the acual invocation. The default verification method will take the "user" method result and call "roles" to list the roles given to that user. DECLARATOR
authorized $name => [qw(required permissions)], $code This declarator will use the default verifier to check if the user has one of the given roles, it will die otherwise. CUSTOM VERIFIERS
The default verifier used is MooseX::Meta::Method::Authorized::CheckRoles, you might send an additional "verifier" option to the declarator with another object or class. A verifier is simply a duck type with the "authorized_do" method that is called as: $verifier->authorized_do($method, $code, @_) It is expected that the verifier code die if the user doesn't fulfill the authorization requests. AUTHORS
Daniel Ruoso <daniel@ruoso.com> COPYRIGHT AND LICENSE
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. perl v5.18.2 2010-11-25 MooseX::AuthorizedMethods(3)
Man Page