| 1 | # | ||||||||||
| 2 | # This file is part of BLAH | ||||||||||
| 3 | # | ||||||||||
| 4 | # This software is Copyright (c) 2015 by Chris Weyl. | ||||||||||
| 5 | # | ||||||||||
| 6 | # This is free software, licensed under: | ||||||||||
| 7 | # | ||||||||||
| 8 | # The GNU Lesser General Public License, Version 2.1, February 1999 | ||||||||||
| 9 | # | ||||||||||
| 10 | package BLAH::Enforces::Authentication; | ||||||||||
| 11 | 2 | our $AUTHORITY = 'cpan:RSRCHBOY'; | |||||||||
| 12 | 2 | $BLAH::Enforces::Authentication::VERSION = '0.001'; # TRIAL | |||||||||
| 13 | # ABSTRACT: BLAH role for enforced authentication | ||||||||||
| 14 | |||||||||||
| 15 | 2 | ▶ | use Moose::Role; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 16 | 2 | ▶ | use namespace::autoclean 0.24; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 17 | |||||||||||
| 18 | 2 | with 'BLAH::Role::Authentication'; | |||||||||
| 19 | |||||||||||
| 20 | |||||||||||
| 21 | 0 | ▶ | before execute => sub { | ||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
| |||||||||||
| 22 | 0 | my $self = shift @_; | |||||||||
| 23 | |||||||||||
| 24 | 0 | ▶ | confess 'Attempt to execute without authentication!' | ||||||||
|
Branch: 1 branch
| |||||||||||
| 25 | unless $self->authenticated; | ||||||||||
| 26 | |||||||||||
| 27 | 0 | return; | |||||||||
| 28 | 2 | }; | |||||||||
| 29 | |||||||||||
| 30 | 2 | !!42; | |||||||||
| 31 | |||||||||||
| 32 | __END__ | ||||||||||