From b2e4b1c46cafbfbe40bfb570ac4f938e8827d56f Mon Sep 17 00:00:00 2001 From: ed Date: Sat, 18 Jul 2026 20:36:41 +0000 Subject: [PATCH] shares: dont suggest write for fileshares; the ui would still show the option to grant write-permission when creating a fileshare; pointless since an existing file can't be overwritten without the delete-permission while this is obvious and nobody would intentionally create a fileshare with write, avoid any confusion by hiding it --- copyparty/web/browser.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index 3603a95f..60d3c8a4 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -4058,6 +4058,11 @@ var fileman = (function () { } shui.style.display = 'block'; + var wr = has(perms, 'write') && !fns.length; + var nope = ['admin', 'move', 'delete', 'upget']; + if (!wr) + nope.push('write'); + var html = [ '
', '', @@ -4078,10 +4083,10 @@ var fileman = (function () { '
perms', ]; for (var a = 0; a < perms.length; a++) - if (!has(['admin', 'move', 'delete', 'upget'], perms[a])) + if (!has(nope, perms[a])) html.push('' + perms[a] + ''); - if (has(perms, 'write')) + if (wr) html.push('write-only'); html.push('