mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-15 15:44:45 -04:00
Added private permission and clean up codes, solved potential race condition in realtime.js
This commit is contained in:
parent
473212676a
commit
49c7dded45
6 changed files with 297 additions and 199 deletions
|
@ -12,7 +12,7 @@ var db = require("./db.js");
|
|||
var logger = require("./logger.js");
|
||||
|
||||
//permission types
|
||||
permissionTypes = ["freely", "editable", "locked"];
|
||||
permissionTypes = ["freely", "editable", "locked", "private"];
|
||||
|
||||
// create a note model
|
||||
var model = mongoose.model('note', {
|
||||
|
@ -126,7 +126,11 @@ function findNote(id, callback) {
|
|||
});
|
||||
}
|
||||
|
||||
function newNote(id, permission, callback) {
|
||||
function newNote(id, owner, callback) {
|
||||
var permission = "freely";
|
||||
if (owner && owner != "null") {
|
||||
permission = "editable";
|
||||
}
|
||||
var note = new model({
|
||||
id: id,
|
||||
permission: permission,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue