|
|
|
@ -1,10 +1,10 @@
|
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
var async = require('async'),
|
|
|
|
|
var async = require('async');
|
|
|
|
|
|
|
|
|
|
var user = require('../user');
|
|
|
|
|
var db = require('./../database');
|
|
|
|
|
|
|
|
|
|
user = require('../user'),
|
|
|
|
|
db = require('./../database'),
|
|
|
|
|
groups = module.parent.exports;
|
|
|
|
|
|
|
|
|
|
module.exports = function (Groups) {
|
|
|
|
|
|
|
|
|
@ -17,7 +17,7 @@ module.exports = function (Groups) {
|
|
|
|
|
async.apply(db.getObjectValues, 'groupslug:groupname'),
|
|
|
|
|
function (groupNames, next) {
|
|
|
|
|
// Ephemeral groups and the registered-users groups are searchable
|
|
|
|
|
groupNames = groups.getEphemeralGroups().concat(groupNames).concat('registered-users');
|
|
|
|
|
groupNames = Groups.getEphemeralGroups().concat(groupNames).concat('registered-users');
|
|
|
|
|
groupNames = groupNames.filter(function (name) {
|
|
|
|
|
return name.toLowerCase().indexOf(query) !== -1 && name !== 'administrators' && !Groups.isPrivilegeGroup(name);
|
|
|
|
|
});
|
|
|
|
|