我想达到这样的目的,资料库权限设置为【只读】后,点开onlyoffice文档不光是只读,还要能够评论。但实际上只读权限只能看,不能添加或回复批注。只有设置为【读写】权限后才能批注。
我查看了onlyoffice的文档,onlyoffice文档里是提供了批注权限接口的:
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", ""]
},
...
},
...
});
我也看了seafile源码, 也是按照onlyoffice的api来做的,https://github.com/haiwen/seahub/blob/master/seahub/templates/view_file_onlyoffice.html
<script type="text/javascript">
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
}
},
.....
但是如果我按照onlyoffice的文档,在permission里添加comment权限
<script type="text/javascript">
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,
"comment": true, # 添加了这里
}
},
就会出现下面的错误,提示“您正在尝试执行您没有权限的操作”
请问是不是在seafile其他地方做了什么限制?