mirror of
https://github.com/nextcloud/richdocuments.git
synced 2025-12-17 21:12:14 +01:00
Merge pull request #2465 from nextcloud/fix/public_share_local_editing
Fix: Hide local editing button for public shares
This commit is contained in:
commit
a477c7bcdc
4 changed files with 6 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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'),
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ class ConfigService {
|
|||
this.loadFromGlobal('directGuest')
|
||||
this.loadFromGlobal('permissions')
|
||||
this.loadFromGlobal('instanceId')
|
||||
this.loadFromGlobal('isPublicShare')
|
||||
}
|
||||
loadFromGlobal(key: string) {
|
||||
// @ts-ignore
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue