mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 00:56:13 +01:00
feat: remove deprecated checkGlobalPrivacySettings
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const nconf = require('nconf');
|
const nconf = require('nconf');
|
||||||
const winston = require('winston');
|
|
||||||
|
|
||||||
const meta = require('../meta');
|
const meta = require('../meta');
|
||||||
const user = require('../user');
|
const user = require('../user');
|
||||||
@@ -76,11 +75,6 @@ module.exports = function (middleware) {
|
|||||||
return next();
|
return next();
|
||||||
}
|
}
|
||||||
|
|
||||||
middleware.checkGlobalPrivacySettings = helpers.try(async function checkGlobalPrivacySettings(req, res, next) {
|
|
||||||
winston.warn('[middleware], checkGlobalPrivacySettings deprecated, use canViewUsers or canViewGroups');
|
|
||||||
await middleware.canViewUsers(req, res, next);
|
|
||||||
});
|
|
||||||
|
|
||||||
middleware.canViewUsers = helpers.try(async function canViewUsers(req, res, next) {
|
middleware.canViewUsers = helpers.try(async function canViewUsers(req, res, next) {
|
||||||
if (parseInt(res.locals.uid, 10) === req.uid) {
|
if (parseInt(res.locals.uid, 10) === req.uid) {
|
||||||
return next();
|
return next();
|
||||||
|
|||||||
Reference in New Issue
Block a user