mirror of
https://github.com/ONLYOFFICE/document-server-integration.git
synced 2026-04-07 14:06:11 +08:00
python: commentGroups
This commit is contained in:
@ -27,12 +27,13 @@
|
||||
from urllib.parse import unquote
|
||||
|
||||
class User:
|
||||
def __init__(self, id, name, email, group, reviewGroups, favorite, deniedPermissions, descriptions):
|
||||
def __init__(self, id, name, email, group, reviewGroups, commentGroups, favorite, deniedPermissions, descriptions):
|
||||
self.id = id
|
||||
self.name = name
|
||||
self.email = email
|
||||
self.group = group
|
||||
self.reviewGroups = reviewGroups
|
||||
self.commentGroups = commentGroups
|
||||
self.favorite = favorite
|
||||
self.deniedPermissions = deniedPermissions
|
||||
self.descriptions = descriptions
|
||||
@ -41,18 +42,21 @@ 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 the comments",
|
||||
"The file favorite state is undefined"
|
||||
]
|
||||
|
||||
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"
|
||||
]
|
||||
|
||||
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",
|
||||
@ -63,15 +67,32 @@ 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 do everything with the comments",
|
||||
"The file favorite state is undefined",
|
||||
"He cannot mention others in the comments"
|
||||
]
|
||||
|
||||
USERS = [
|
||||
User('uid-1', 'John Smith', 'smith@mail.ru', None, None, None, [], descr_user_1),
|
||||
User('uid-2', 'Mark Pottato', 'pottato@mail.ru', 'group-2', ['group-2', ''], True, [], descr_user_2),
|
||||
User('uid-3', 'Hamish Mitchell', 'mitchell@mail.ru', 'group-3', ['group-2'], False, ["copy", "download", "print"], descr_user_3),
|
||||
User('uid-0', None, None, None, None, None, [], descr_user_0)
|
||||
User('uid-1', 'John Smith', 'smith@mail.ru',
|
||||
None, None, {},
|
||||
None, [], descr_user_1),
|
||||
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),
|
||||
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),
|
||||
User('uid-0', None, None,
|
||||
None, None, {},
|
||||
None, [], descr_user_0)
|
||||
]
|
||||
|
||||
DEFAULT_USER = USERS[0]
|
||||
|
||||
@ -172,7 +172,8 @@ def edit(request):
|
||||
'modifyFilter': edMode != 'filter',
|
||||
'modifyContentControl': edMode != "blockcontent",
|
||||
'review': canEdit & ((edMode == 'edit') | (edMode == 'review')),
|
||||
'reviewGroups': user.reviewGroups
|
||||
'reviewGroups': user.reviewGroups,
|
||||
'commentGroups': user.commentGroups
|
||||
}
|
||||
},
|
||||
'editorConfig': {
|
||||
|
||||
Reference in New Issue
Block a user