mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 15:36:16 -04:00
Merge pull request #819 from marcelklehr/contributor-api-methods
Contributor api methods (listPadsOfAuthor & listAuthorsOfPad )
This commit is contained in:
commit
a717c11ab3
4 changed files with 132 additions and 2 deletions
|
@ -47,6 +47,7 @@ exports.createGroupPad = groupManager.createGroupPad;
|
|||
|
||||
exports.createAuthor = authorManager.createAuthor;
|
||||
exports.createAuthorIfNotExistsFor = authorManager.createAuthorIfNotExistsFor;
|
||||
exports.listPadsOfAuthor = authorManager.listPadsOfAuthor;
|
||||
|
||||
/**********************/
|
||||
/**SESSION FUNCTIONS***/
|
||||
|
@ -481,6 +482,26 @@ exports.isPasswordProtected = function(padID, callback)
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
listAuthorsOfPad(padID) returns an array of authors who contributed to this pad
|
||||
|
||||
Example returns:
|
||||
|
||||
{code: 0, message:"ok", data: {authorIDs : ["a.s8oes9dhwrvt0zif", "a.akf8finncvomlqva"]}
|
||||
{code: 1, message:"padID does not exist", data: null}
|
||||
*/
|
||||
exports.listAuthorsOfPad = function(padID, callback)
|
||||
{
|
||||
//get the pad
|
||||
getPadSafe(padID, true, function(err, pad)
|
||||
{
|
||||
if(ERR(err, callback)) return;
|
||||
|
||||
callback(null, {authorIDs: pad.getAllAuthors()});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/******************************/
|
||||
/** INTERNAL HELPER FUNCTIONS */
|
||||
/******************************/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue