mirror of
https://github.com/cryptpad/cryptpad.git
synced 2026-09-14 11:05:41 +05:00
Make sure we can't request edit access to ourselves
This commit is contained in:
parent
0ab6d4d995
commit
d74b2b6316
@ -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]);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user