diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index e4f3d961..8bf3bca6 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -1699,6 +1699,8 @@ class HttpCli(object): "tag_order": [], "have_up2k_idx": ("e2d" in vn.flags), "have_tags_idx": ("e2t" in vn.flags), + "have_mv": (not self.args.no_mv), + "have_del": (not self.args.no_del), "have_zip": (not self.args.no_zip), "have_b_u": (self.can_write and self.uparam.get("b") == "u"), "url_suf": url_suf, diff --git a/copyparty/web/browser.html b/copyparty/web/browser.html index 7c65a75c..bf3bac3b 100644 --- a/copyparty/web/browser.html +++ b/copyparty/web/browser.html @@ -126,6 +126,8 @@ tag_order_cfg = {{ tag_order }}, have_up2k_idx = {{ have_up2k_idx|tojson }}, have_tags_idx = {{ have_tags_idx|tojson }}, + have_mv = {{ have_mv|tojson }}, + have_del = {{ have_del|tojson }}, have_zip = {{ have_zip|tojson }}; diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index 996d8ace..772657ed 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -1483,10 +1483,10 @@ var fileman = (function () { clmod(bdel, 'en', sel.length); clmod(bcut, 'en', sel.length); clmod(bpst, 'en', r.clip && r.clip.length); - bren.style.display = has(perms, 'write') && has(perms, 'move') ? '' : 'none'; - bdel.style.display = has(perms, 'delete') ? '' : 'none'; - bcut.style.display = has(perms, 'move') ? '' : 'none'; - bpst.style.display = has(perms, 'write') ? '' : 'none'; + bren.style.display = have_mv && has(perms, 'write') && has(perms, 'move') ? '' : 'none'; + bdel.style.display = have_del && has(perms, 'delete') ? '' : 'none'; + bcut.style.display = have_mv && has(perms, 'move') ? '' : 'none'; + bpst.style.display = have_mv && has(perms, 'write') ? '' : 'none'; bpst.setAttribute('tt', 'paste ' + r.clip.length + ' items$NHotkey: ctrl-V'); ebi('wfm').style.display = QS('#wfm a.en:not([display])') ? '' : 'none'; }; diff --git a/tests/test_httpcli.py b/tests/test_httpcli.py index 6a8ee8ba..98c30344 100644 --- a/tests/test_httpcli.py +++ b/tests/test_httpcli.py @@ -31,6 +31,8 @@ class Cfg(Namespace): rproxy=0, ed=False, nw=False, + no_mv=False, + no_del=False, no_zip=False, no_voldump=True, no_scandir=False,