Created
June 2, 2014 17:12
-
-
Save navarroaxel/b86aa5ce8ad4b26a2b85 to your computer and use it in GitHub Desktop.
A user with the correct permission can use the users API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var router = require('express').Router(); | |
| router.use(require('permission.js')('manageUsers')); | |
| /* GET users listing. */ | |
| router.get('/', function(req, res) { | |
| res.send('respond with a resource'); | |
| }); | |
| /* GET a user */ | |
| router.get('/:id', function(req, res) { | |
| res.send('This is the user id ' + req.params.id); | |
| }); | |
| module.exports = router; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment