Skip to content

make require_login and require_role available in the load_app #15

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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