diff options
author | Vincent Petry <pvince81@owncloud.com> | 2016-06-23 15:43:21 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2016-06-24 09:48:48 +0200 |
commit | 955635c7aaaf932c698069a08ff8f218f0ea990c (patch) | |
tree | 3c7d63791490f9311044c7370f234388baba9fff /apps/files_sharing/tests/ApiTest.php | |
parent | dc78d26f2abec23e68b5dd3011f698d7b9f6e6a3 (diff) | |
download | nextcloud-server-955635c7aaaf932c698069a08ff8f218f0ea990c.tar.gz nextcloud-server-955635c7aaaf932c698069a08ff8f218f0ea990c.zip |
Add explicit delete permission to link shares
Link shares always allowed deletion, however internally the permissions
were stored as 7 which lacked delete permissions. This created an
inconsistency in the Webdav permissions.
This fix makes sure we include delete permissions in the share
permissions, which now become 15.
In case a client is still passing 7 for legacy reasons, it gets
converted automatically to 15.
Diffstat (limited to 'apps/files_sharing/tests/ApiTest.php')
-rw-r--r-- | apps/files_sharing/tests/ApiTest.php | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/apps/files_sharing/tests/ApiTest.php b/apps/files_sharing/tests/ApiTest.php index 058b0c4758c..40c9085353c 100644 --- a/apps/files_sharing/tests/ApiTest.php +++ b/apps/files_sharing/tests/ApiTest.php @@ -257,7 +257,13 @@ class ApiTest extends TestCase { $this->assertTrue($result->succeeded()); $data = $result->getData(); - $this->assertEquals(7, $data['permissions']); + $this->assertEquals( + \OCP\Constants::PERMISSION_READ | + \OCP\Constants::PERMISSION_CREATE | + \OCP\Constants::PERMISSION_UPDATE | + \OCP\Constants::PERMISSION_DELETE, + $data['permissions'] + ); $this->assertEmpty($data['expiration']); $this->assertTrue(is_string($data['token'])); @@ -1081,7 +1087,13 @@ class ApiTest extends TestCase { $this->assertTrue($result->succeeded()); $share1 = $this->shareManager->getShareById($share1->getFullId()); - $this->assertEquals(7, $share1->getPermissions()); + $this->assertEquals( + \OCP\Constants::PERMISSION_READ | + \OCP\Constants::PERMISSION_CREATE | + \OCP\Constants::PERMISSION_UPDATE | + \OCP\Constants::PERMISSION_DELETE, + $share1->getPermissions() + ); // cleanup $this->shareManager->deleteShare($share1); |