summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-10-29 17:56:54 +0100
committerVincent Petry <pvince81@owncloud.com>2015-10-29 17:56:54 +0100
commitdcfaf3afdc903212e1eca9fe353ede07c6eac7b1 (patch)
tree739730fedcc5f0d5467c79aa146052ccc25b5a95
parent73d9699be9d2a343b0573dc6a5bcc65f5f9c7303 (diff)
downloadnextcloud-server-dcfaf3afdc903212e1eca9fe353ede07c6eac7b1.tar.gz
nextcloud-server-dcfaf3afdc903212e1eca9fe353ede07c6eac7b1.zip
Bring back delete permission in share overview
-rw-r--r--apps/files_sharing/js/sharedfilelist.js12
-rw-r--r--apps/files_sharing/tests/js/sharedfilelistSpec.js26
2 files changed, 11 insertions, 27 deletions
diff --git a/apps/files_sharing/js/sharedfilelist.js b/apps/files_sharing/js/sharedfilelist.js
index edf138b97ae..68bfd63ec89 100644
--- a/apps/files_sharing/js/sharedfilelist.js
+++ b/apps/files_sharing/js/sharedfilelist.js
@@ -105,11 +105,7 @@
},
getDirectoryPermissions: function() {
- var perms = OC.PERMISSION_READ;
- if (this._sharedWithUser) {
- perms |= OC.PERMISSION_DELETE;
- }
- return perms;
+ return OC.PERMISSION_READ | OC.PERMISSION_DELETE;
},
updateStorageStatistics: function() {
@@ -271,11 +267,7 @@
}
file.name = OC.basename(share.path);
file.path = OC.dirname(share.path);
- if (this._sharedWithUser) {
- file.permissions = OC.PERMISSION_ALL;
- } else {
- file.permissions = OC.PERMISSION_ALL - OC.PERMISSION_DELETE;
- }
+ file.permissions = OC.PERMISSION_ALL;
if (file.path) {
file.extraData = share.path;
}
diff --git a/apps/files_sharing/tests/js/sharedfilelistSpec.js b/apps/files_sharing/tests/js/sharedfilelistSpec.js
index 90ae9c2d6da..b4b6ac4954a 100644
--- a/apps/files_sharing/tests/js/sharedfilelistSpec.js
+++ b/apps/files_sharing/tests/js/sharedfilelistSpec.js
@@ -85,7 +85,7 @@ describe('OCA.Sharing.FileList tests', function() {
file_source: 49,
file_target: '/local path/local name.txt',
path: 'files/something shared.txt',
- permissions: OC.PERMISSION_ALL,
+ permissions: 31,
stime: 11111,
share_type: OC.Share.SHARE_TYPE_USER,
share_with: 'user1',
@@ -159,8 +159,7 @@ describe('OCA.Sharing.FileList tests', function() {
expect($tr.attr('data-file')).toEqual('local name.txt');
expect($tr.attr('data-path')).toEqual('/local path');
expect($tr.attr('data-size')).not.toBeDefined();
- expect(parseInt($tr.attr('data-permissions'), 10))
- .toEqual(OC.PERMISSION_ALL); // read and delete
+ expect($tr.attr('data-permissions')).toEqual('31'); // read and delete
expect($tr.attr('data-mime')).toEqual('text/plain');
expect($tr.attr('data-mtime')).toEqual('11111000');
expect($tr.attr('data-share-owner')).toEqual('User Two');
@@ -236,8 +235,7 @@ describe('OCA.Sharing.FileList tests', function() {
expect($tr.attr('data-file')).toEqual('local name');
expect($tr.attr('data-path')).toEqual('/local path');
expect($tr.attr('data-size')).not.toBeDefined();
- expect(parseInt($tr.attr('data-permissions'), 10))
- .toEqual(OC.PERMISSION_ALL); // read and delete
+ expect($tr.attr('data-permissions')).toEqual('31'); // read and delete
expect($tr.attr('data-mime')).toEqual('httpd/unix-directory');
expect($tr.attr('data-mtime')).toEqual('11111000');
expect($tr.attr('data-share-owner')).toEqual('User Two');
@@ -333,8 +331,7 @@ describe('OCA.Sharing.FileList tests', function() {
expect($tr.attr('data-file')).toEqual('local name.txt');
expect($tr.attr('data-path')).toEqual('/local path');
expect($tr.attr('data-size')).not.toBeDefined();
- expect(parseInt($tr.attr('data-permissions'), 10))
- .toEqual(OC.PERMISSION_ALL - OC.PERMISSION_DELETE); // read
+ expect($tr.attr('data-permissions')).toEqual('31'); // read and delete
expect($tr.attr('data-mime')).toEqual('text/plain');
expect($tr.attr('data-mtime')).toEqual('11111000');
expect($tr.attr('data-share-owner')).not.toBeDefined();
@@ -375,8 +372,7 @@ describe('OCA.Sharing.FileList tests', function() {
expect($tr.attr('data-file')).toEqual('local name');
expect($tr.attr('data-path')).toEqual('/local path');
expect($tr.attr('data-size')).not.toBeDefined();
- expect(parseInt($tr.attr('data-permissions'), 10))
- .toEqual(OC.PERMISSION_ALL - OC.PERMISSION_DELETE); // read
+ expect($tr.attr('data-permissions')).toEqual('31'); // read and delete
expect($tr.attr('data-mime')).toEqual('httpd/unix-directory');
expect($tr.attr('data-mtime')).toEqual('11111000');
expect($tr.attr('data-share-owner')).not.toBeDefined();
@@ -427,8 +423,7 @@ describe('OCA.Sharing.FileList tests', function() {
expect($tr.attr('data-file')).toEqual('local name.txt');
expect($tr.attr('data-path')).toEqual('/local path');
expect($tr.attr('data-size')).not.toBeDefined();
- expect(parseInt($tr.attr('data-permissions'), 10))
- .toEqual(OC.PERMISSION_ALL - OC.PERMISSION_DELETE); // read
+ expect($tr.attr('data-permissions')).toEqual('31'); // read and delete
expect($tr.attr('data-mime')).toEqual('text/plain');
expect($tr.attr('data-mtime')).toEqual('11111000');
expect($tr.attr('data-share-owner')).not.toBeDefined();
@@ -496,8 +491,7 @@ describe('OCA.Sharing.FileList tests', function() {
expect($tr.attr('data-file')).toEqual('local name.txt');
expect($tr.attr('data-path')).toEqual('/local path');
expect($tr.attr('data-size')).not.toBeDefined();
- expect(parseInt($tr.attr('data-permissions'), 10))
- .toEqual(OC.PERMISSION_ALL - OC.PERMISSION_DELETE); // read
+ expect($tr.attr('data-permissions')).toEqual('31'); // read and delete
expect($tr.attr('data-mime')).toEqual('text/plain');
// always use the most recent stime
expect($tr.attr('data-mtime')).toEqual('22222000');
@@ -591,8 +585,7 @@ describe('OCA.Sharing.FileList tests', function() {
expect($tr.attr('data-file')).toEqual('local name.txt');
expect($tr.attr('data-path')).toEqual('/local path');
expect($tr.attr('data-size')).not.toBeDefined();
- expect(parseInt($tr.attr('data-permissions'), 10))
- .toEqual(OC.PERMISSION_ALL - OC.PERMISSION_DELETE); // read
+ expect($tr.attr('data-permissions')).toEqual('31'); // read and delete
expect($tr.attr('data-mime')).toEqual('text/plain');
expect($tr.attr('data-mtime')).toEqual('11111000');
expect($tr.attr('data-share-recipients')).not.toBeDefined();
@@ -633,8 +626,7 @@ describe('OCA.Sharing.FileList tests', function() {
expect($tr.attr('data-file')).toEqual('local name.txt');
expect($tr.attr('data-path')).toEqual('/local path');
expect($tr.attr('data-size')).not.toBeDefined();
- expect(parseInt($tr.attr('data-permissions'), 10))
- .toEqual(OC.PERMISSION_ALL - OC.PERMISSION_DELETE); // read
+ expect($tr.attr('data-permissions')).toEqual('31'); // read and delete
expect($tr.attr('data-mime')).toEqual('text/plain');
expect($tr.attr('data-mtime')).toEqual('11111000');
expect($tr.attr('data-share-recipients')).not.toBeDefined();