ForbesLindesay / connect-roles

Provides dynamic roles based authorisation for node.js connect and express servers.
749 stars 62 forks source link

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

Closed ForbesLindesay closed 10 years ago

ForbesLindesay commented 11 years ago

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);
ForbesLindesay commented 10 years ago

This will be implemented in the next version