]> source.dussan.org Git - nextcloud-server.git/commitdiff
File shares can't have create permissions
authorRoeland Jago Douma <rullzer@owncloud.com>
Mon, 14 Dec 2015 13:03:14 +0000 (14:03 +0100)
committerRoeland Jago Douma <rullzer@owncloud.com>
Mon, 14 Dec 2015 13:03:14 +0000 (14:03 +0100)
fixes #21187

apps/files_sharing/js/share.js
apps/files_sharing/tests/js/sharedfilelistSpec.js

index 3d105f283d85bdb54ae1b1a8d5c66045000038c6..f8d89828f4d03e41dcbc442f0d16ffd1dcf25cd7 100644 (file)
@@ -45,6 +45,9 @@
                                if (fileData.type === 'file') {
                                        // files can't be shared with delete permissions
                                        sharePermissions = sharePermissions & ~OC.PERMISSION_DELETE;
+
+                                       // create permissions don't mean anything for files
+                                       sharePermissions = sharePermissions & ~OC.PERMISSION_CREATE;
                                }
                                tr.attr('data-share-permissions', sharePermissions);
                                if (fileData.shareOwner) {
index fdc9de49c174c5bdab1d3cb59d4dc6db62b00b25..0b0676a19e6380e71ea7bbd620ca807998a49afc 100644 (file)
@@ -712,7 +712,7 @@ describe('OCA.Sharing.FileList tests', function() {
                        $tr = fileList.$el.find('tr:first');
 
                        expect(parseInt($tr.attr('data-share-permissions'), 10))
-                               .toEqual(OC.PERMISSION_ALL - OC.PERMISSION_SHARE - OC.PERMISSION_DELETE);
+                               .toEqual(OC.PERMISSION_ALL - OC.PERMISSION_SHARE - OC.PERMISSION_DELETE - OC.PERMISSION_CREATE);
                });
        });
 });