mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 12:05:57 +01:00
added gdpr check socket method
This commit is contained in:
@@ -353,3 +353,16 @@ SocketUser.gdpr = {};
|
|||||||
SocketUser.gdpr.consent = function (socket, data, callback) {
|
SocketUser.gdpr.consent = function (socket, data, callback) {
|
||||||
user.setUserField(socket.uid, 'gdpr_consent', 1, callback);
|
user.setUserField(socket.uid, 'gdpr_consent', 1, callback);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
SocketUser.gdpr.check = function (socket, data, callback) {
|
||||||
|
async.waterfall([
|
||||||
|
async.apply(user.isAdministrator, socket.uid),
|
||||||
|
function (isAdmin, next) {
|
||||||
|
if (!isAdmin) {
|
||||||
|
data.uid = socket.uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
db.getObjectField('user:' + data.uid, 'gdpr_consent', next);
|
||||||
|
},
|
||||||
|
], callback);
|
||||||
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user