]> source.dussan.org Git - nextcloud-server.git/commitdiff
don't show 'notify by mail' option or permissions not available for mail shares
authorBjoern Schiessle <bjoern@schiessle.org>
Wed, 26 Oct 2016 09:27:43 +0000 (11:27 +0200)
committerBjoern Schiessle <bjoern@schiessle.org>
Tue, 1 Nov 2016 18:54:41 +0000 (19:54 +0100)
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
apps/files_sharing/lib/Controller/ShareAPIController.php
apps/sharebymail/templates/altmail.php
core/js/sharedialogshareelistview.js

index 186f314a1c8e4269252e5b38897d4a03ede55f9d..ae8165602a6fb35d872ec95e49e42c4f1043f0e1 100644 (file)
@@ -432,7 +432,8 @@ class ShareAPIController extends OCSController {
                                $share->setPermissions(
                                        \OCP\Constants::PERMISSION_READ |
                                        \OCP\Constants::PERMISSION_CREATE |
-                                       \OCP\Constants::PERMISSION_UPDATE);
+                                       \OCP\Constants::PERMISSION_UPDATE |
+                                       \OCP\Constants::PERMISSION_DELETE);
                        }
                        $share->setSharedWith($shareWith);
                } else {
index 02d262d72296047432bb4e250f8e7a9d2af128af..7b9de6295ff9a0ef852951a0458c43e644a0ad7a 100644 (file)
@@ -31,6 +31,6 @@ p($l->t("Cheers!"));
 print_unescaped("\n");
 ?>
 
--- 
+--
 <?php p($theme->getName() . ' - ' . $theme->getSlogan()); ?>
 <?php print_unescaped("\n".$theme->getBaseUrl());
index cca698905c200ba8b6a78130f56c004abaf22d55..775eaa554b04f14dce51b883a98debfff97f6245 100644 (file)
                                        '<span class="has-tooltip username" title="{{shareWithTitle}}">{{shareWithDisplayName}}</span>' +
                                        '<span class="sharingOptionsGroup">' +
                                                '{{#if editPermissionPossible}}' +
+                                               '{{#unless isFileSharedByMail}}' +
                                                '<span class="shareOption">' +
                                                        '<input id="canEdit-{{cid}}-{{shareWith}}" type="checkbox" name="edit" class="permissions checkbox" {{#if hasEditPermission}}checked="checked"{{/if}} />' +
                                                        '<label for="canEdit-{{cid}}-{{shareWith}}">{{canEditLabel}}</label>' +
                                                '</span>' +
+                                               '{{/unless}}' +
                                                '{{/if}}' +
+                                               '{{#unless isMailShare}}' +
                                                '<a href="#"><span class="icon icon-more"></span></a>' +
                                                '<div class="popovermenu bubble hidden menu">' +
                                                        '<ul>' +
-                                                               '{{#if isResharingAllowed}} {{#if sharePermissionPossible}}' +
+                                                               '{{#if isResharingAllowed}} {{#if sharePermissionPossible}} {{#unless isMailShare}}' +
                                                                '<li>' +
                                                                        '<span class="shareOption">' +
                                                                                '<input id="canShare-{{cid}}-{{shareWith}}" type="checkbox" name="share" class="permissions checkbox" {{#if hasSharePermission}}checked="checked"{{/if}} data-permissions="{{sharePermission}}" />' +
                                                                                '<label for="canShare-{{cid}}-{{shareWith}}">{{canShareLabel}}</label>' +
                                                                        '</span>' +
                                                                '</li>' +
-                                                               '{{/if}} {{/if}}' +
+                                                               '{{/unless}} {{/if}} {{/if}}' +
                                                                '{{#if isFolder}}' +
                                                                        '{{#if createPermissionPossible}}' +
                                                                        '<li>' +
@@ -74,7 +77,9 @@
                                                                '</li>' +
                                                        '</ul>' +
                                                '</div>' +
-                                               '</span>' +
+                                               '{{/unless}}' +
+                                               '<a href="#" class="unshare"><span class="icon-loading-small hidden"></span><span class="icon icon-delete"></span><span class="hidden-visually">{{unshareLabel}}</span></a>' +
+                                       '</span>' +
                                '</li>' +
                        '{{/each}}' +
                        '{{#each linkReshares}}' +
                                shareType: shareType,
                                shareId: this.model.get('shares')[shareIndex].id,
                                modSeed: shareType !== OC.Share.SHARE_TYPE_USER,
-                               isRemoteShare: shareType === OC.Share.SHARE_TYPE_REMOTE
+                               isRemoteShare: shareType === OC.Share.SHARE_TYPE_REMOTE,
+                               isMailShare: shareType === OC.Share.SHARE_TYPE_EMAIL,
+                               isFileSharedByMail: shareType === OC.Share.SHARE_TYPE_EMAIL && !this.model.isFolder()
                        });
                },