From 0741ffc307ab92e5e56d6b546142c14a6960dfea Mon Sep 17 00:00:00 2001 From: ansuz Date: Wed, 15 Dec 2021 13:45:43 +0530 Subject: [PATCH] prompt guests to login/register when they have shared folder edit rights... but not if they only have view rights --- www/common/drive-ui.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/www/common/drive-ui.js b/www/common/drive-ui.js index 6fbc381b7..fcbc6fcf6 100644 --- a/www/common/drive-ui.js +++ b/www/common/drive-ui.js @@ -3908,8 +3908,13 @@ define([ } if (APP.readOnly && !APP.loggedIn) { - // XXX this incorrectly prompts guests to login/register even when they lack editing rights. (function () { + // show 'READ-ONLY' when a guest only has view rights + if (/\/view\//.test(APP.anonSFHref)) { + $content.prepend($readOnly.clone()); + return; + } + // otherwise prompt them to log in or register to take advantage of their edit rights var $banner = $(Pages.setHTML(h('div.cp-app-drive-content-info-box'), Messages.fm_info_sharedFolder)); $banner.find('[href="/login/"], [href="/register/"]').click(function (ev) { ev.preventDefault();