I install onlyoffice server for seafile, but when I modify the user permissions, the user can neither edit nor comment.
But what I need is that users cannot edit, but can comment.
So I read the document of onlyoffice, then found that I could modify permission for onlyoffice, see https://api.onlyoffice.com/editors/config/document/permissions
# a frontsite demo to change onlyoffice permission
var docEditor = new DocsAPI.DocEditor("placeholder", {
"document": {
"permissions": {
"chat": true,
"comment": true,
"commentGroups": {
"edit": ["Group2", ""],
"remove": [""],
"view": ""
},
"copy": true,
"deleteCommentAuthorOnly": false,
"download": true,
"edit": true,
"editCommentAuthorOnly": false,
"fillForms": true,
"modifyContentControl": true,
"modifyFilter": true,
"print": true,
"protect": true,
"review": true,
"reviewGroups": ["Group1", "Group2", ""],
"userInfoGroups": ["Group1", ""]
},
...
},
...
});
Then I found the same config in seafile, see https://github.com/haiwen/seahub/blob/736a3a18f15b705298f8c3c444ff8c693596c586/seahub/templates/view_file_onlyoffice.html
var config = {
"type": window.screen.width < 992 ? 'mobile' : 'desktop',
"document": {
"fileType": "{{ file_type }}",
"key": "{{ doc_key }}",
"title": "{{ doc_title|escapejs }}",
"url": "{{ doc_url }}",
"permissions": {
"download": {% if can_download %}true{% else %}false{% endif %},
"edit": {% if can_edit %}true{% else %}false{% endif %},
"print": {% if can_download %}true{% else %}false{% endif %},
"review": true
}
},
"documentType": "{{ document_type }}", // 'text' | 'spreadsheet' | 'presentation',
{% if onlyoffice_jwt_token %}
"token": "{{ onlyoffice_jwt_token }}",
{% endif %}
"editorConfig": {
"callbackUrl": "{{ callback_url }}",
"lang": "{{ LANGUAGE_CODE }}",
"mode": {% if can_edit %}"edit"{% else %}"view"{% endif %},
"customization": {
"forcesave": {% if onlyoffice_force_save %}true{% else %}false{% endif %},
{% if not request.user.is_authenticated %}
"anonymous": {
"request": true,
"label": "Guest"
},
{% endif %}
},
{% if request.user.is_authenticated %}
"user": {
"id": "{{ username|escapejs }}",
"name": "{{ username|email2nickname|escapejs }}"
}
{% endif %}
}
};
But when I modify the permission like this
"permissions": {
"download": {% if can_download %}true{% else %}false{% endif %},
"edit": {% if can_edit %}true{% else %}false{% endif %},
"print": {% if can_download %}true{% else %}false{% endif %},
"review": true,
"comment": true
}
That make some error, told me ’ You are trying to perform an action you do not have rights for’
Can anyone tell me how to make it?