summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/js/share.js15
-rw-r--r--apps/files_sharing/tests/js/sharedfilelistSpec.js9
2 files changed, 7 insertions, 17 deletions
diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js
index b2715912d3b..22513e1b470 100644
--- a/apps/files_sharing/js/share.js
+++ b/apps/files_sharing/js/share.js
@@ -254,20 +254,7 @@
* @returns {String}
*/
getSharePermissions: function(fileData) {
- var sharePermissions = fileData.permissions;
- if (fileData.mountType && fileData.mountType === "external-root"){
- // for external storages we can't use the permissions of the mountpoint
- // instead we show all permissions and only use the share permissions from the mountpoint to handle resharing
- sharePermissions = sharePermissions | (OC.PERMISSION_ALL & ~OC.PERMISSION_SHARE);
- }
- 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;
- }
- return sharePermissions;
+ return fileData.sharePermissions;
}
};
})();
diff --git a/apps/files_sharing/tests/js/sharedfilelistSpec.js b/apps/files_sharing/tests/js/sharedfilelistSpec.js
index 903234947bd..492a7255c61 100644
--- a/apps/files_sharing/tests/js/sharedfilelistSpec.js
+++ b/apps/files_sharing/tests/js/sharedfilelistSpec.js
@@ -723,6 +723,7 @@ describe('OCA.Sharing.FileList tests', function() {
mimetype: 'text/plain',
size: 12,
permissions: OC.PERMISSION_READ,
+ sharePermissions: OC.PERMISSION_READ,
etag: 'abc',
shareOwner: 'User One',
recipients: 'User Two',
@@ -730,7 +731,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);
+ expect(parseInt($tr.attr('data-share-permissions'), 10)).toEqual(OC.PERMISSION_READ);
});
it('external storage root folder reshare', function () {
@@ -744,6 +745,7 @@ describe('OCA.Sharing.FileList tests', function() {
mimetype: 'text/plain',
size: 12,
permissions: OC.PERMISSION_READ + OC.PERMISSION_SHARE,
+ sharePermissions: OC.PERMISSION_READ + OC.PERMISSION_SHARE,
etag: 'abc',
shareOwner: 'User One',
recipients: 'User Two',
@@ -751,7 +753,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);
+ expect(parseInt($tr.attr('data-share-permissions'), 10)).toEqual(OC.PERMISSION_READ + OC.PERMISSION_SHARE);
});
it('external storage root folder file', function () {
@@ -765,6 +767,7 @@ describe('OCA.Sharing.FileList tests', function() {
mimetype: 'text/plain',
size: 12,
permissions: OC.PERMISSION_READ,
+ sharePermissions: OC.PERMISSION_READ,
etag: 'abc',
shareOwner: 'User One',
recipients: 'User Two',
@@ -773,7 +776,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 - OC.PERMISSION_CREATE);
+ .toEqual(OC.PERMISSION_READ);
});
});
});