ForbesLindesay/connect-roles

Add a way to support skipping to the next handler on access denied

ForbesLindesay opened this issue · 1 comments

It would be useful to be able to have something like:

app.get('/', user.isAuthenticated, showAuthenticatedHomePage);
app.get('/', showAnonymousHomePage);

That API wouldn't be sufficient to differentiate between that and:

app.all('/admin*', user.is('admin'));
app.get('/admin/settings', showSettingsPage);

Perhaps we could support something like:

app.get('/', user.is('admin').here, showAdminHomePage);
app.get('/', user.isAuthenticated.here, showAuthenticatedHomePage);
app.get('/', showAnonymousHomePage);

This will be implemented in the next version