[Pkg-owncloud-commits] [owncloud] 88/107: Bring back delete permission in share overview
David Prévot
taffit at moszumanska.debian.org
Thu Dec 17 19:40:40 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch stable8
in repository owncloud.
commit 709f9231e99ecc05bfc8c3c654897db796124c80
Author: Vincent Petry <pvince81 at owncloud.com>
Date: Thu Oct 29 17:56:54 2015 +0100
Bring back delete permission in share overview
---
apps/files_sharing/js/sharedfilelist.js | 12 ++---------
apps/files_sharing/tests/js/sharedfilelistSpec.js | 26 ++++++++---------------
2 files changed, 11 insertions(+), 27 deletions(-)
diff --git a/apps/files_sharing/js/sharedfilelist.js b/apps/files_sharing/js/sharedfilelist.js
index 2e798a9..8fdf7d5 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 90ae9c2..b4b6ac4 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();
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list