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:
@@ -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,
|
||||
|
Reference in New Issue
Block a user