|
|
|
@ -27,7 +27,7 @@ searchController.search = async function (req, res, next) {
|
|
|
|
|
'search:content': privileges.global.can('search:content', req.uid),
|
|
|
|
|
'search:tags': privileges.global.can('search:tags', req.uid),
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
req.query.in = req.query.in || 'posts';
|
|
|
|
|
const allowed = (req.query.in === 'users' && userPrivileges['search:users']) ||
|
|
|
|
|
(req.query.in === 'tags' && userPrivileges['search:tags']) ||
|
|
|
|
|
(['titles', 'titlesposts', 'posts'].includes(req.query.in) && userPrivileges['search:content']);
|
|
|
|
@ -45,7 +45,7 @@ searchController.search = async function (req, res, next) {
|
|
|
|
|
|
|
|
|
|
const data = {
|
|
|
|
|
query: req.query.term,
|
|
|
|
|
searchIn: req.query.in || 'posts',
|
|
|
|
|
searchIn: req.query.in,
|
|
|
|
|
matchWords: req.query.matchWords || 'all',
|
|
|
|
|
postedBy: req.query.by,
|
|
|
|
|
categories: req.query.categories,
|
|
|
|
|