1
0
Fork 0
mirror of synced 2024-06-30 12:10:51 +12:00

Merge branch 'master' of github.com:appwrite/appwrite into functions

This commit is contained in:
Eldad Fux 2020-07-12 20:20:28 +03:00
commit 286b42787f
7 changed files with 10 additions and 3 deletions

View file

@ -39,6 +39,7 @@
- Fixed bug denying authentication with Github OAuth provider - Fixed bug denying authentication with Github OAuth provider
- New OAuth adapter for Box.com - New OAuth adapter for Box.com
- New OAuth adapter for PayPal sandbox - New OAuth adapter for PayPal sandbox
- Fixed a bug making read permission overwrite write permission in some cases
## Breaking Changes ## Breaking Changes
- **Deprecated** `first` and `last` query params for documents list route in the database API - **Deprecated** `first` and `last` query params for documents list route in the database API

View file

@ -613,7 +613,7 @@ $utopia->patch('/v1/database/collections/:collectionId/documents/:documentId')
} }
if (!empty($write)) { // Overwrite permissions only when passed if (!empty($write)) { // Overwrite permissions only when passed
$data['$permissions']['write'] = $read; $data['$permissions']['write'] = $write;
} }
$data = \array_merge($document->getArrayCopy(), $data); $data = \array_merge($document->getArrayCopy(), $data);

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 48 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 42 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 88 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 37 KiB

View file

@ -415,8 +415,8 @@ trait DatabaseBase
'name' => 'Thor: Ragnaroc', 'name' => 'Thor: Ragnaroc',
'releaseYear' => 2017, 'releaseYear' => 2017,
], ],
'read' => ['user:'.$this->getUser()['$id']], 'read' => ['user:'.$this->getUser()['$id'], 'testx'],
'write' => ['user:'.$this->getUser()['$id']], 'write' => ['user:'.$this->getUser()['$id'], 'testy'],
]); ]);
$id = $document['body']['$id']; $id = $document['body']['$id'];
@ -425,6 +425,8 @@ trait DatabaseBase
$this->assertEquals($document['headers']['status-code'], 201); $this->assertEquals($document['headers']['status-code'], 201);
$this->assertEquals($document['body']['name'], 'Thor: Ragnaroc'); $this->assertEquals($document['body']['name'], 'Thor: Ragnaroc');
$this->assertEquals($document['body']['releaseYear'], 2017); $this->assertEquals($document['body']['releaseYear'], 2017);
$this->assertEquals($document['body']['$permissions']['read'][1], 'testx');
$this->assertEquals($document['body']['$permissions']['write'][1], 'testy');
$document = $this->client->call(Client::METHOD_PATCH, '/database/collections/' . $collection . '/documents/' . $id, array_merge([ $document = $this->client->call(Client::METHOD_PATCH, '/database/collections/' . $collection . '/documents/' . $id, array_merge([
'content-type' => 'application/json', 'content-type' => 'application/json',