Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- api.post('/salvarEvento', md_auth.ensureAuth, EventoController.saveEvento);
- 'use strict'
- exports.isAdmin = function(req, res, next){
- if (req.user.role != 'ROLE_ADMIN') {
- return res.status(200).send({
- mensagem: 'Você não tem acesso a zona',
- });
- }
- next();
- };
- api.post('/salvarEvento', md_auth.ensureAuth, EventoController.saveEvento);
- api.post('/salvarEvento', [ md_auth.ensureAuth, md_admin.isAdmin ], EventoController.saveEvento);
- 'use strict'
- exports.isAdmin = function(req, res, next){
- if (req.user.role != 'ROLE_ADMIN') {
- return res.status(200).send({
- mensagem: 'Você não tem acesso a zona',
- });
- }
- next();
- };
Add Comment
Please, Sign In to add comment