Skip to content

make require_login and require_role available in the load_app #15

Open
@pwfraley

Description

@pwfraley

It would be cool to be able to:

load_app 'App::User',   prefix => '/user', require_login
load_app 'App::Admin',   prefix => '/admin', require_role Admin

And then also be able to use it in the loaded apps:

package App::User
use Dancer ':syntax';

### you only get here if you are logged in, but the next action is only available if you are an Editor
get '/' => require_role Editor => sub {
    return 'You are Editor :)';
};

true;

Just an Idea, have not seen any possibility to do that yet ... maybe I overlooked something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions