added getReadOnlyID
This commit is contained in:
parent
7b030710d2
commit
3e0f30bdde
|
@ -20,6 +20,7 @@
|
||||||
|
|
||||||
var padManager = require("./PadManager");
|
var padManager = require("./PadManager");
|
||||||
var padMessageHandler = require("../handler/PadMessageHandler");
|
var padMessageHandler = require("../handler/PadMessageHandler");
|
||||||
|
var readOnlyManager = require("./ReadOnlyManager");
|
||||||
var async = require("async");
|
var async = require("async");
|
||||||
|
|
||||||
/**********************/
|
/**********************/
|
||||||
|
@ -404,9 +405,23 @@ Example returns:
|
||||||
{code: 0, message:"ok", data: null}
|
{code: 0, message:"ok", data: null}
|
||||||
{code: 1, message:"padID does not exist", data: null}
|
{code: 1, message:"padID does not exist", data: null}
|
||||||
*/
|
*/
|
||||||
exports.getReadOnlyLink = function(padID, callback)
|
exports.getReadOnlyID = function(padID, callback)
|
||||||
{
|
{
|
||||||
|
//we don't need the pad object, but this function does all the security stuff for us
|
||||||
|
getPadSafe(padID, function(err)
|
||||||
|
{
|
||||||
|
if(err)
|
||||||
|
{
|
||||||
|
callback(err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//get the readonlyId
|
||||||
|
readOnlyManager.getReadOnlyId(padID, function(err, readOnlyId)
|
||||||
|
{
|
||||||
|
callback(err, {readOnlyID: readOnlyId});
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -53,7 +53,7 @@ var functions = {
|
||||||
"setText" : ["padID", "text"],
|
"setText" : ["padID", "text"],
|
||||||
"getRevisionsCount" : ["padID"],
|
"getRevisionsCount" : ["padID"],
|
||||||
// "deletePad" : ["padID"],
|
// "deletePad" : ["padID"],
|
||||||
// "getReadOnlyLink" : ["padID"],
|
"getReadOnlyID" : ["padID"],
|
||||||
// "setPublicStatus" : ["padID", "publicStatus"],
|
// "setPublicStatus" : ["padID", "publicStatus"],
|
||||||
// "getPublicStatus" : ["padID"],
|
// "getPublicStatus" : ["padID"],
|
||||||
// "setPassword" : ["padID", "password"],
|
// "setPassword" : ["padID", "password"],
|
||||||
|
|
Loading…
Reference in New Issue