diff --git a/CHANGES.md b/CHANGES.md index 406b697921..f5ffdc97fb 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -39,6 +39,7 @@ - Fixed bug denying authentication with Github OAuth provider - New OAuth adapter for Box.com - New OAuth adapter for PayPal sandbox +- Fixed a bug making read permission overwrite write permission in some cases ## Breaking Changes - **Deprecated** `first` and `last` query params for documents list route in the database API diff --git a/app/controllers/api/database.php b/app/controllers/api/database.php index af0e358a64..dadf7e9576 100644 --- a/app/controllers/api/database.php +++ b/app/controllers/api/database.php @@ -613,7 +613,7 @@ $utopia->patch('/v1/database/collections/:collectionId/documents/:documentId') } if (!empty($write)) { // Overwrite permissions only when passed - $data['$permissions']['write'] = $read; + $data['$permissions']['write'] = $write; } $data = \array_merge($document->getArrayCopy(), $data); diff --git a/docs/specs/custom-domains.drawio.svg b/docs/specs/custom-domains.drawio.svg new file mode 100644 index 0000000000..73b7520c3d --- /dev/null +++ b/docs/specs/custom-domains.drawio.svg @@ -0,0 +1 @@ +
Console
Console
Domain Verification
Domain Verification
DNS Validation
DNS Validation
SSL Generator
(100 hosts per cert)
SSL Generator...
Renewals in 60 days
Renewals in 60 days
Cert 1
Cert 1
appwrite.io
appwrite.io
DNS Server
DNS Server
CNAME Record
CNAME Record
TXT Record
TXT Record
Loadbalancer
Loadbalancer
SSL Certificates
SSL Certificates
    appwrite.demoapp.com/v1    
    appwrite.demoapp.com/v1    
demoapp.com
demoapp.com
Platforms
Platforms
Custom Domains
Custom Domains
Web
Web
Cert 2
Cert 2
Cert 3
Cert 3
Cert 4
Cert 4
Cert 5
Cert 5

Custom Domains

Specification for adding, validating and generating custom domains
and SSL certificates for the Appwrite API.

Custom Domains...
Viewer does not support full SVG 1.1
\ No newline at end of file diff --git a/docs/specs/functions.drawio.svg b/docs/specs/functions.drawio.svg new file mode 100644 index 0000000000..a5f50b743f --- /dev/null +++ b/docs/specs/functions.drawio.svg @@ -0,0 +1 @@ +
Console
Console
Code Packger
(CLI Tool?)
Code Packger...
Web IDE
(Based on PRISM?)
Web IDE...
Database
Database
Functions
Functions
PHP
PHP
Node.js
Node.js
appwrite
appwrite
    appwrite.demoapp.com/v1    
    appwrite.demoapp.com/v1    
demoapp.com
demoapp.com

Cloud Functions

Specification for adding, executing and managing custom, user supplied cloud functions.

Cloud Functions...
Python
Python
Ruby
Ruby
Versions / Tags
Versions / Tags
Encrypted Code
(Storage)
Encrypted Code...
Execution
Execution
Worker
Worker
Warmup / Pull
(All Docker Images)
Warmup / Pull...
Execute Code
(Limit Execution Time)
Execute Code...
Log Result
Log Result
Viewer does not support full SVG 1.1
\ No newline at end of file diff --git a/docs/specs/overview.drawio.svg b/docs/specs/overview.drawio.svg new file mode 100644 index 0000000000..7b376f6604 --- /dev/null +++ b/docs/specs/overview.drawio.svg @@ -0,0 +1 @@ +
Web
Web
Flutter
Flutter
iOS
iOS
Android
Android
Servers
Servers
Appwrite
Appwrite
Loadbalancer
Loadbalancer
Console
Console
APIs
APIs
Pub/Sub (Redis)
Pub/Sub (Redis)
Cache (Redis)
Cache (Redis)
Database (MariaDB)
Database (MariaDB)
Users
Users
Account
Account
Teams
Teams
Database
Database
Storage
Storage
Localization
Localization
Avatars
Avatars
Health
Health
SSL Gateway
SSL Gateway
Deletes
Deletes
Security Layer
Security Layer
Usage
Usage
Audits
Audits
Mails
Mails
SMTP
SMTP
Tasks
Tasks
Webhooks
Webhooks
Functions
Functions
Docker
Docker
StatsD (Telegraf)
StatsD (Telegraf)
TimeSeries (InfluxDB)
TimeSeries (InfluxDB)
Certs
Certs
Scheduler
Scheduler
Letsencrypt
Letsencrypt
AntiVirus (ClamAV)
AntiVirus (ClamAV)
Viewer does not support full SVG 1.1
\ No newline at end of file diff --git a/docs/specs/realtime.drawio.svg b/docs/specs/realtime.drawio.svg new file mode 100644 index 0000000000..93788ddd2a --- /dev/null +++ b/docs/specs/realtime.drawio.svg @@ -0,0 +1 @@ +
Appwrite API
Appwrite API
Send all events
Send all events
Messaging Worker
Messaging Worker
Redis - Message Log
Redis - Message Log
Expire Every x seconds
Expire Every x secon...
Websocket 1
Websocket 1
Connections
Connections
Events
Events
Authorization
Authorization
Websocket 2
Websocket 2
Websocket 3
Websocket 3
Pull
Pull
Connections
Connections
Events
Events
Authorization
Authorization
Connections
Connections
Events
Events
Authorization
Authorization
Clients
Clients
LoadBalancer
LoadBalancer

Real Time
Specification for adding, a sclabale, realtime stream to trasmit Appwrite system and user generated events to any platform.

Real Time...
Viewer does not support full SVG 1.1
\ No newline at end of file diff --git a/tests/e2e/Services/Database/DatabaseBase.php b/tests/e2e/Services/Database/DatabaseBase.php index 7e68940104..f769184827 100644 --- a/tests/e2e/Services/Database/DatabaseBase.php +++ b/tests/e2e/Services/Database/DatabaseBase.php @@ -415,8 +415,8 @@ trait DatabaseBase 'name' => 'Thor: Ragnaroc', 'releaseYear' => 2017, ], - 'read' => ['user:'.$this->getUser()['$id']], - 'write' => ['user:'.$this->getUser()['$id']], + 'read' => ['user:'.$this->getUser()['$id'], 'testx'], + 'write' => ['user:'.$this->getUser()['$id'], 'testy'], ]); $id = $document['body']['$id']; @@ -425,6 +425,8 @@ trait DatabaseBase $this->assertEquals($document['headers']['status-code'], 201); $this->assertEquals($document['body']['name'], 'Thor: Ragnaroc'); $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([ 'content-type' => 'application/json',