mirror of
https://github.com/ether/etherpad-lite.git
synced 2026-02-28 19:11:44 +01:00
db/SecurityManager.js: convert checkAccess() to thenify
This commit is contained in:
parent
23a3a079a6
commit
34fdaa4e8c
@ -27,6 +27,7 @@ var sessionManager = require("./SessionManager");
|
||||
var settings = require("../utils/Settings");
|
||||
var log4js = require('log4js');
|
||||
var authLogger = log4js.getLogger("auth");
|
||||
const thenify = require("thenify").withCallback;
|
||||
|
||||
/**
|
||||
* This function controlls the access to a pad, it checks if the user can access a pad.
|
||||
@ -36,7 +37,7 @@ var authLogger = log4js.getLogger("auth");
|
||||
* @param password the password the user has given to access this pad, can be null
|
||||
* @param callback will be called with (err, {accessStatus: grant|deny|wrongPassword|needPassword, authorID: a.xxxxxx})
|
||||
*/
|
||||
exports.checkAccess = function(padID, sessionCookie, token, password, callback)
|
||||
exports.checkAccess = thenify(function(padID, sessionCookie, token, password, callback)
|
||||
{
|
||||
var statusObject;
|
||||
|
||||
@ -300,4 +301,4 @@ exports.checkAccess = function(padID, sessionCookie, token, password, callback)
|
||||
|
||||
callback(null, statusObject);
|
||||
});
|
||||
};
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user