diff options
Diffstat (limited to 'server/lib/views/staff.js')
| -rw-r--r-- | server/lib/views/staff.js | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/server/lib/views/staff.js b/server/lib/views/staff.js index 70ca414..ffacee2 100644 --- a/server/lib/views/staff.js +++ b/server/lib/views/staff.js @@ -356,7 +356,14 @@ var staff = module.exports = { staff.users.bless ); - + + if (app.get('env') === 'development') { + app.get('/staff/authorize', + middleware.ensureAuthenticated, + staff.users.blessSelf + ); + } + // // projects @@ -463,6 +470,12 @@ var staff = module.exports = { res.render('staff/users/show_404') } }, + blessSelf: function(req, res){ + req.user.isStaff = true + req.user.save(function(err, user){ + res.json({ state: user.isStaff }) + }) + }, bless: function(req, res){ res.locals.profile.isStaff = req.body.state == "true" res.locals.profile.save(function(err, user){ |
