closes #6464
parent
19491b5210
commit
a7267df404
@ -1,8 +1,5 @@
|
||||
{
|
||||
"handles": "Guest Handles",
|
||||
"handles.enabled": "Allow guest handles",
|
||||
"handles.enabled-help": "This option exposes a new field that allows guests to pick a name to associate with each post they make. If disabled, they will simply be called \"Guest\"",
|
||||
"privileges": "Guest Privileges",
|
||||
"privileges.can-search": "Allow guests to search without logging in",
|
||||
"privileges.can-search-users": "Allow guests to search users without logging in"
|
||||
"handles.enabled-help": "This option exposes a new field that allows guests to pick a name to associate with each post they make. If disabled, they will simply be called \"Guest\""
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
'use strict';
|
||||
|
||||
var async = require('async');
|
||||
|
||||
module.exports = {
|
||||
name: 'Give global search privileges',
|
||||
timestamp: Date.UTC(2018, 4, 28),
|
||||
method: function (callback) {
|
||||
var meta = require('../../meta');
|
||||
var privileges = require('../../privileges');
|
||||
var allowGuestSearching = parseInt(meta.config.allowGuestSearching, 10) === 1;
|
||||
var allowGuestUserSearching = parseInt(meta.config.allowGuestUserSearching, 10) === 1;
|
||||
async.waterfall([
|
||||
function (next) {
|
||||
privileges.global.give(['search:content', 'search:users', 'search:tags'], 'registered-users', next);
|
||||
},
|
||||
function (next) {
|
||||
var guestPrivs = [];
|
||||
if (allowGuestSearching) {
|
||||
guestPrivs.push('search:content');
|
||||
}
|
||||
if (allowGuestUserSearching) {
|
||||
guestPrivs.push('search:users');
|
||||
}
|
||||
guestPrivs.push('search:tags');
|
||||
privileges.global.give(guestPrivs, 'guests', next);
|
||||
},
|
||||
], callback);
|
||||
},
|
||||
};
|
Loading…
Reference in New Issue