NAME

Mojolicious::Plugin::RoutesAuthDBI::Admin - is a mixed Mojolicious::Controller. It invoking from plugin module and might also using as standard Mojolicious::Controller. From plugin it controll access to routes trought sintax of ->over(...), see Mojolicious::Routes::Route#over

SYNOPSIS

$app->plugin('RoutesAuthDBI', 
    dbh => $app->dbh,
    auth => {...},
    access => {...},
    admin => {< options below >},
);
  • namespace - default 'Mojolicious::Plugin::RoutesAuthDBI',

  • controller - module controller name, default 'Admin',

    Both above options determining the module controller for web actions on tables routes, roles, users and refs between them.

  • prefix -is a prefix for admin urls of this module. Default as name of controller lowcase.

  • trust is a url subprefix for trust admin urls of this module. See defaults below.

Defaults

admin = > {
    namespace => 'Mojolicious::Plugin::RoutesAuthDBI',
    module => 'Admin',
    prefix => 'admin',
    trust => $app->secrets->[0],
},

admin = {}, # empty hashref sets defaults above

admin => undef, # disables routing of admin controller

admin = > {prefix=>'myadmin', trust => 'foooobaaar'},# admin urls like: /myadmin/foooobaaar/.....

METHODS NEEDS IN PLUGIN

  • self_routes() - builtin this access controller routes. Return array of hashrefs routes records for apply route on app. Depends on conf options prefix and trust.

AUTHOR

Михаил Че (Mikhail Che), <mche [on] cpan.org>

BUGS / CONTRIBUTING

Please report any bugs or feature requests at https://github.com/mche/Mojolicious-Plugin-RoutesAuthDBI/issues. Pull requests also welcome.

COPYRIGHT

Copyright 2016 Mikhail Che.

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