MetaStore::IsAuthed - WebDAO component for check current user.


MetaStore documentation Contained in the MetaStore distribution.

Index


Code Index:

NAME

Top

MetaStore::IsAuthed - WebDAO component for check current user.

SYNOPSIS

Top

    ...
    <regclass class="MetaStore::IsAuthed" alias="isauth"/>
    <object class="isauth" id="auth_switch1">
    <auth>
        <object class="man" id="manager">1</object>
    </auth>
    <noauth>
       <object class="main" id="page"/>

    </noauth>
    ...

DESCRIPTION

Top

WebDAO component for check current user.

METHODS

Top

SEE ALSO

Top

MetaStore, WebDAO::Element, README

AUTHOR

Top

Zahatski Aliaksandr, <zag@cpan.org>

COPYRIGHT AND LICENSE

Top


MetaStore documentation Contained in the MetaStore distribution.
package MetaStore::IsAuthed;

use Data::Dumper;
use strict;
use warnings;
use base qw(WebDAO::Element);
__PACKAGE__->attributes qw/ __init /;

sub init {
    my $self = shift;
    my %arg  = @_;
    $self->__init( \%arg );
}

sub __get_self_refs {
    my $self = shift;

    #get user
    my %args = %{ $self->__init };
    return $self->getEngine->_auth->is_authed ? $args{auth} : $args{noauth};
}


1;
__END__