| 1 | package Yukki::Role::App; | ||
| 2 | 15 | $Yukki::Role::App::VERSION = '0.991_002'; # TRIAL | |
| 3 | |||
| 4 | 15 | ▶ | $Yukki::Role::App::VERSION = '0.991002';use v5.24; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 15 | ▶ | use utf8; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 15 | ▶ | use Moo::Role; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 15 | requires qw( | |
| 9 | model | ||
| 10 | view | ||
| 11 | controller | ||
| 12 | locate | ||
| 13 | locate_dir | ||
| 14 | check_access | ||
| 15 | ); | ||
| 16 | |||
| 17 | # ABSTRACT: the role Yukki app-classes implement | ||
| 18 | |||
| 19 | |||
| 20 | 15 | 1; | |
| 21 | |||
| 22 | __END__ | ||
| 23 | |||
| 24 | =pod | ||
| 25 | |||
| 26 | =encoding UTF-8 | ||
| 27 | |||
| 28 | =head1 NAME | ||
| 29 | |||
| 30 | Yukki::Role::App - the role Yukki app-classes implement | ||
| 31 | |||
| 32 | =head1 VERSION | ||
| 33 | |||
| 34 | version 0.991_002 | ||
| 35 | |||
| 36 | =head1 DESCRIPTION | ||
| 37 | |||
| 38 | The L<Yukki> and L<Yukki::Web> classes fulfill this role. | ||
| 39 | |||
| 40 | =head1 REQUIRED METHODS | ||
| 41 | |||
| 42 | =head2 model | ||
| 43 | |||
| 44 | my $obj = $self->model($name, \%params); | ||
| 45 | |||
| 46 | Given a name and an optional hash of parameters, return an instance of a | ||
| 47 | L<Yukki::Model>. | ||
| 48 | |||
| 49 | =head2 view | ||
| 50 | |||
| 51 | my $obj = $self->view($name); | ||
| 52 | |||
| 53 | Given a name, return a view object. | ||
| 54 | |||
| 55 | =head2 controller | ||
| 56 | |||
| 57 | my $obj = $self->controller($name); | ||
| 58 | |||
| 59 | Given a name, return a controller object. | ||
| 60 | |||
| 61 | =head2 locate | ||
| 62 | |||
| 63 | my $file = $self->locate($base_path, @path_parts); | ||
| 64 | |||
| 65 | Given a configuration key in C<$base_path> and some C<@path_parts> to append, | ||
| 66 | return a L<Path::Class::File> representing that file under the Yukki | ||
| 67 | installation. | ||
| 68 | |||
| 69 | =head2 locate_dir | ||
| 70 | |||
| 71 | my $dir = $self->locate_dir($base_path, @path_parts); | ||
| 72 | |||
| 73 | Given a configuration key in C<$base_path> and some C<@path_parts> to append, | ||
| 74 | return a L<Path::Class::Dir> representing that directory under the Yukki | ||
| 75 | installation. | ||
| 76 | |||
| 77 | =head2 check_access | ||
| 78 | |||
| 79 | my $access_is_ok = $self->check_access({ | ||
| 80 | user => $user, | ||
| 81 | repository => $repository, | ||
| 82 | needs => $needs, | ||
| 83 | }); | ||
| 84 | |||
| 85 | The C<user> is optional. It should be an object returned from | ||
| 86 | L<Yukki::Model::User>. The C<repository> is required and should be the name of | ||
| 87 | the repository the user is trying to gain access to. The C<needs> is the access | ||
| 88 | level the user needs. It must be an L<Yukki::Types/AccessLevel>. | ||
| 89 | |||
| 90 | The method returns a true value if access should be granted or false otherwise. | ||
| 91 | |||
| 92 | =head1 AUTHOR | ||
| 93 | |||
| 94 | Andrew Sterling Hanenkamp <hanenkamp@cpan.org> | ||
| 95 | |||
| 96 | =head1 COPYRIGHT AND LICENSE | ||
| 97 | |||
| 98 | This software is copyright (c) 2017 by Qubling Software LLC. | ||
| 99 | |||
| 100 | This is free software; you can redistribute it and/or modify it under | ||
| 101 | the same terms as the Perl 5 programming language system itself. | ||
| 102 | |||
| 103 | =cut | ||