From d74b2b631682d0c6d79b7a32f201bd294d7cb7b2 Mon Sep 17 00:00:00 2001 From: yflory Date: Thu, 4 Feb 2021 17:31:37 +0100 Subject: [PATCH] Make sure we can't request edit access to ourselves --- www/common/inner/access.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/www/common/inner/access.js b/www/common/inner/access.js index f06028d8e..1dd0c2600 100644 --- a/www/common/inner/access.js +++ b/www/common/inner/access.js @@ -992,8 +992,10 @@ define([ // Also stop for shared folders if (parsed.hashData.type !== 'pad' || parsed.type === 'drive') { return h('div', content); } + var owned = Modal.isOwned(Env, data); + // Request edit access - if (common.isLoggedIn() && ((data.roHref && !data.href) || data.fakeHref)) { + if (common.isLoggedIn() && ((data.roHref && !data.href) || data.fakeHref) && !owned) { var requestButton = h('button.btn.btn-secondary.no-margin.cp-access-margin-right', Messages.requestEdit_button); var requestBlock = h('p', requestButton); @@ -1028,7 +1030,6 @@ define([ // Mute access requests var edPublic = priv.edPublic; - var owned = Modal.isOwned(Env, data); var canMute = data.mailbox && owned === true && ( (typeof (data.mailbox) === "string" && data.owners[0] === edPublic) || data.mailbox[edPublic]);