1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-16 15:19:06 +00:00

enable co-editing for share link with can_edit permission

This commit is contained in:
lian
2021-11-11 17:16:15 +08:00
parent 25138c0a78
commit 9fc84d4e1e

View File

@@ -1152,9 +1152,12 @@ def view_shared_file(request, fileshare):
is_locked = False
locked_by_me = False
locked_by_online_office = if_locked_by_online_office(repo_id, path)
# get share link permission
can_download = fileshare.get_permissions()['can_download']
can_edit = fileshare.get_permissions()['can_edit'] and not is_locked
can_edit = fileshare.get_permissions()['can_edit'] and \
(not is_locked or locked_by_online_office)
# download shared file
if request.GET.get('dl', '') == '1':
@@ -1201,7 +1204,6 @@ def view_shared_file(request, fileshare):
if filetype in (DOCUMENT, SPREADSHEET):
def online_office_lock_or_refresh_lock(repo_id, path, username):
locked_by_online_office = if_locked_by_online_office(repo_id, path)
try:
if not is_locked:
seafile_api.lock_file(repo_id, path, ONLINE_OFFICE_LOCK_OWNER,