diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index 62215280..637edb69 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -4145,6 +4145,8 @@ var fileman = (function () { if (this.textContent == 'write-only') for (var a = 0; a < pbtns.length; a++) clmod(pbtns[a], 'on', pbtns[a].textContent == 'write'); + if (this.textContent == 'get' && clgot(this, 'on') && has(perms, 'read')) + clmod(pbtns[0], 'on'); } clmod(pbtns[0], 'on', 1); @@ -8032,22 +8034,18 @@ function apply_perms(res) { a.style.display = ''; tt.att(QS('#ops')); - // read implies get, no need to show it - var displayed_perms = perms.slice(0); - var have_read = has(displayed_perms, 'read') - if (have_read) { - var get_index = displayed_perms.indexOf('get'); - if (get_index > -1) { - displayed_perms.splice(get_index, 1); - } - } + + var v_perms = perms.slice(0); + var have_read = has(perms, 'read'); + if (have_read) + apop(v_perms, 'get'); for (var a = 0; a < chk.length; a++) - if (has(displayed_perms, chk[a])) + if (has(v_perms, chk[a])) axs.push(chk[a].slice(0, 1).toUpperCase() + chk[a].slice(1)); axs = axs.join('-'); - if (displayed_perms.length == 1) { + if (v_perms.length == 1) { aclass = ' class="warn">'; axs += '-Only'; }