nodejs: commentGroups

This commit is contained in:
Dmitrii Vershinin
2021-06-15 11:16:12 +02:00
parent b9e70b913a
commit a815d30725
3 changed files with 30 additions and 6 deletions

View File

@ -20,18 +20,21 @@ var descr_user_1 = [
"File author by default",
"He doesnt 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 dont 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 isnt favorite",
"He cant copy data from the file into the clipboard",
"He cant 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 doesnt 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;