diff --git a/nodejs/routes/user.js b/nodejs/routes/user.js index a6a17ba..f977e1d 100755 --- a/nodejs/routes/user.js +++ b/nodejs/routes/user.js @@ -6,8 +6,9 @@ const permission = require('../utils/permission'); router.get('/', async function(req, res, next){ try{ + await permission.byGroup(req.user, ['app_sso_admin']) return res.json({ - results: await User[req.query.detail ? "listDetail" : "list"]() + results: await User[req.query.detail ? "listDetail" : "list"](), }); }catch(error){ next(error); diff --git a/nodejs/views/groups.ejs b/nodejs/views/groups.ejs index 4e50d27..61aa728 100644 --- a/nodejs/views/groups.ejs +++ b/nodejs/views/groups.ejs @@ -113,6 +113,11 @@ function getUserList(callback){ app.user.list(function(error, data){ + var $target = $('#tableAJAX'); + if(error){ + app.util.actionMessage(data.message, $target, 'danger'); + return; + } userlist = data.results; callback() }); @@ -140,6 +145,7 @@ app.util.actionMessage('Refreshing user list...', $target); app.group.list(function(error, data){ + console.log('error 5555', error, data); var out = '' $.each(data.results, function(key, value) { @@ -211,7 +217,8 @@ -