Merge pull request #2465 from nextcloud/fix/public_share_local_editing

Fix: Hide local editing button for public shares
This commit is contained in:
Julius Härtl 2022-09-28 08:24:50 +02:00 committed by GitHub
commit a477c7bcdc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 1 deletions

View file

@ -307,6 +307,7 @@ class DocumentController extends Controller {
'instanceId' => $this->config->getSystemValue('instanceid'),
'canonical_webroot' => $this->appConfig->getAppValue('canonical_webroot'),
'userId' => $this->uid,
'isPublicShare' => true,
];
list($urlSrc, $token, $wopi) = $this->tokenManager->getToken($item->getId(), $shareToken, $this->uid);

View file

@ -308,7 +308,9 @@ const documentsMain = {
if (Config.get('userId') === null) {
PostMessages.sendWOPIPostMessage('loolframe', 'Hide_Menu_Item', { id: 'insertgraphicremote' })
} else {
}
if (Config.get('userId') !== null && !Config.get('isPublicShare')) {
PostMessages.sendWOPIPostMessage('loolframe', 'Insert_Button', {
id: 'Open_Local_Editor',
imgurl: window.location.protocol + '//' + getNextcloudUrl() + imagePath('richdocuments', 'launch.svg'),

View file

@ -31,6 +31,7 @@ class ConfigService {
this.loadFromGlobal('directGuest')
this.loadFromGlobal('permissions')
this.loadFromGlobal('instanceId')
this.loadFromGlobal('isPublicShare')
}
loadFromGlobal(key: string) {
// @ts-ignore

View file

@ -11,6 +11,7 @@
var richdocuments_canonical_webroot = '<?php p($_['canonical_webroot']) ?>';
var richdocuments_directEdit = <?php isset($_['direct']) ? p('true') : p('false') ?>;
var richdocuments_directGuest = <?php isset($_['directGuest']) ? p('true') : p('false') ?>;
var richdocuments_isPublicShare = <?php isset($_['isPublicShare']) && $_['isPublicShare'] ? p('true') : p('false') ?>;
</script>
<?php