Skip to content

takuji31/Amon2-Web-Authorizer

Repository files navigation

NAME
    Amon2::Web::Authorizer - Amon2 authorization module

VERSION
    This document describes Amon2::Web::Authorizer version 0.01.

SYNOPSIS
        #Your Web class
        __PACKAGE__->load_plugin(
            'Web::Authorizer' => {
                config => 'List',
                data   => [
                    '/user/only' => {
                        modules => [
                            'Session' => {
                                key => 'is_user',
                            },
                        ],
                        on_error => 'login',
                    },
                    '/user/mypage' => {
                        modules => [
                            'or' => [
                                'Session' => {
                                    key => 'is_user',
                                },
                                'Session' => {
                                    key => 'is_dev',
                                },
                            ],
                        ],
                        on_error => 'login',
                    },
                    '/developer/only' => {
                        modules => [
                            'and' => [
                                'Session' => {
                                    key => 'is_user',
                                },
                                'Session' => {
                                    key => 'is_dev',
                                },
                            ],
                        ],
                        on_error => 'login',
                    },
                ],
                error_callbacks =>{
                    login => sub {
                        my ($c, $args) = @_;
                        return $c->redirect('/account/login');
                    },
                },
            },
        );

DESCRIPTION
    # TODO

INTERFACE
  Functions
   "hello()"
    # TODO

DEPENDENCIES
    Perl 5.12.1 or later.

BUGS
    All complex software has bugs lurking in it, and this module is no
    exception. If you find a bug please either email me, or add the bug to
    cpan-RT.

SEE ALSO
    Amon2

AUTHOR
    Nishibayashi Takuji <takuji31@gmail.com>

LICENSE AND COPYRIGHT
    Copyright (c) 2012, Nishibayashi Takuji. All rights reserved.

    This library is free software; you can redistribute it and/or modify it
    under the same terms as Perl itself.

About

Amon2 authorization plugin

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages