fix: internal helper method hasGlobalPrivilege, DRY

This commit is contained in:
Julian Lam
2020-11-16 15:42:39 -05:00
parent d83eb7f89e
commit e1d7c4d8aa
2 changed files with 11 additions and 17 deletions

View File

@@ -243,9 +243,10 @@ async function render(req, res, data) {
data['filterBy_' + validator.escape(String(filter))] = true;
});
data.showInviteButton = await privileges.users.hasInvitePrivilege(req.uid);
if (data.adminInviteOnly) {
data.showInviteButton = await privileges.users.isAdministrator(req.uid);
} else {
data.showInviteButton = await privileges.users.hasInvitePrivilege(req.uid);
}
res.render('admin/manage/users', data);