diff --git a/web/documentserver-example/nodejs/app.js b/web/documentserver-example/nodejs/app.js index 51b73d8b..0b618385 100644 --- a/web/documentserver-example/nodejs/app.js +++ b/web/documentserver-example/nodejs/app.js @@ -640,6 +640,7 @@ app.get("/editor", function (req, res) { // define a handler for editing docume var userGroup = user.group; var reviewGroups = user.reviewGroups; + var commentGroups = user.commentGroups; if (fileExt != null) { var fileName = docManager.createDemo(!!req.query.sample, fileExt, userid, name); // create demo document of a given extension @@ -760,6 +761,7 @@ app.get("/editor", function (req, res) { // define a handler for editing docume name: name, userGroup: userGroup, reviewGroups: JSON.stringify(reviewGroups), + commentGroups: JSON.stringify(commentGroups), fileChoiceUrl: fileChoiceUrl, submitForm: submitForm, plugins: JSON.stringify(plugins), diff --git a/web/documentserver-example/nodejs/helpers/users.js b/web/documentserver-example/nodejs/helpers/users.js index 2acf3680..46508751 100644 --- a/web/documentserver-example/nodejs/helpers/users.js +++ b/web/documentserver-example/nodejs/helpers/users.js @@ -20,18 +20,21 @@ var descr_user_1 = [ "File author by default", "He doesn’t belong to any of the groups", "He can review all the changes", + "He can do everything with comments", "The file favorite state is undefined" ]; var descr_user_2 = [ "He belongs to Group2", "He can review only his own changes or the changes made by the users who don’t belong to any of the groups", + "He can view, edit and delete only his comments and the comments left by the users who don't belong to any of the groups", "This file is favorite" ]; var descr_user_3 = [ "He belongs to Group3", "He can review only the changes made by the users from Group2", + "He can view, edit and delete only his comments and the comments left by the users from Group2", "This file isn’t favorite", "He can’t copy data from the file into the clipboard", "He can’t download the file", @@ -42,23 +45,41 @@ var descr_user_0 = [ "The user without a name. The name is requested upon the editor opening", "He doesn’t belong to any of the groups", "He can review all the changes", + "He can view only his comments", "The file favorite state is undefined", "He cannot mention others in the comments" ]; var users = [ - new User("uid-1", "John Smith", "smith@mail.ru", null, null, null, [], descr_user_1), - new User("uid-2", "Mark Pottato", "pottato@mail.ru", "group-2", ["group-2", ""], true, [], descr_user_2), // own and without group - new User("uid-3", "Hamish Mitchell", "mitchell@mail.ru", "group-3", ["group-2"], false, ["copy", "download", "print"], descr_user_3), // other group only - new User("uid-0", null, null, null, null, null, [], descr_user_0), + new User("uid-1", "John Smith", "smith@mail.ru", + null, null, {}, + null, [], descr_user_1), + new User("uid-2", "Mark Pottato", "pottato@mail.ru", + "group-2", ["group-2", ""], { + view: ["group-2", ""], + edit: ["group-2", ""], + remove: ["group-2", ""] + }, + true, [], descr_user_2), // own and without group + new User("uid-3", "Hamish Mitchell", "mitchell@mail.ru", + "group-3", ["group-2"], { + view: ["group-3", "group-2"], + edit: ["group-2"], + remove: ["group-2"] + }, + false, ["copy", "download", "print"], descr_user_3), // other group only + new User("uid-0", null, null, + null, null, {}, + null, [], descr_user_0), ]; -function User(id, name, email, group, reviewGroups, favorite, deniedPermissions, descriptions) { +function User(id, name, email, group, reviewGroups, commentGroups, favorite, deniedPermissions, descriptions) { this.id = id; this.name = name; this.email = email; this.group = group; this.reviewGroups = reviewGroups; + this.commentGroups = commentGroups; this.favorite = favorite; this.deniedPermissions = deniedPermissions; this.descriptions = descriptions; diff --git a/web/documentserver-example/nodejs/views/config.ejs b/web/documentserver-example/nodejs/views/config.ejs index b176fa90..851819e7 100644 --- a/web/documentserver-example/nodejs/views/config.ejs +++ b/web/documentserver-example/nodejs/views/config.ejs @@ -23,7 +23,8 @@ "modifyFilter": <%- editor.modifyFilter %>, "modifyContentControl": <%- editor.modifyContentControl %>, "review": <%- editor.review %>, - "reviewGroups": <%- editor.reviewGroups %> + "reviewGroups": <%- editor.reviewGroups %>, + "commentGroups": <%- editor.commentGroups %> } }, "editorConfig": {