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 @@ +ConsoleConsoleDomain VerificationDomain VerificationDNS ValidationDNS ValidationSSL Generator(100 hosts per cert)SSL Generator...Renewals in 60 daysRenewals in 60 daysCert 1Cert 1appwrite.ioappwrite.ioDNS ServerDNS ServerCNAME RecordCNAME RecordTXT RecordTXT RecordLoadbalancerLoadbalancerSSL CertificatesSSL Certificates appwrite.demoapp.com/v1 appwrite.demoapp.com/v1 demoapp.comdemoapp.comPlatformsPlatformsCustom DomainsCustom DomainsWebWebCert 2Cert 2Cert 3Cert 3Cert 4Cert 4Cert 5Cert 5Custom DomainsSpecification for adding, validating and generating custom domainsand 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 @@ +ConsoleConsoleCode Packger(CLI Tool?)Code Packger...Web IDE(Based on PRISM?)Web IDE...DatabaseDatabaseFunctionsFunctionsPHPPHPNode.jsNode.jsappwriteappwrite appwrite.demoapp.com/v1 appwrite.demoapp.com/v1 demoapp.comdemoapp.comCloud FunctionsSpecification for adding, executing and managing custom, user supplied cloud functions.Cloud Functions...PythonPythonRubyRubyVersions / TagsVersions / TagsEncrypted Code(Storage)Encrypted Code...ExecutionExecutionWorkerWorkerWarmup / Pull(All Docker Images)Warmup / Pull...Execute Code(Limit Execution Time)Execute Code...Log ResultLog ResultViewer 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 @@ +WebWebFlutterFlutteriOSiOSAndroidAndroidServersServersAppwriteAppwriteLoadbalancerLoadbalancerConsoleConsoleAPIsAPIsPub/Sub (Redis)Pub/Sub (Redis)Cache (Redis)Cache (Redis)Database (MariaDB)Database (MariaDB)UsersUsersAccountAccountTeamsTeamsDatabaseDatabaseStorageStorageLocalizationLocalizationAvatarsAvatarsHealthHealthSSL GatewaySSL GatewayDeletesDeletesSecurity LayerSecurity LayerUsageUsageAuditsAuditsMailsMailsSMTPSMTPTasksTasksWebhooksWebhooksFunctionsFunctionsDockerDockerStatsD (Telegraf)StatsD (Telegraf)TimeSeries (InfluxDB)TimeSeries (InfluxDB)CertsCertsSchedulerSchedulerLetsencryptLetsencryptAntiVirus (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 APIAppwrite APISend all eventsSend all eventsMessaging WorkerMessaging WorkerRedis - Message LogRedis - Message LogExpire Every x secondsExpire Every x secon...Websocket 1Websocket 1ConnectionsConnectionsEventsEventsAuthorizationAuthorizationWebsocket 2Websocket 2Websocket 3Websocket 3PullPullConnectionsConnectionsEventsEventsAuthorizationAuthorizationConnectionsConnectionsEventsEventsAuthorizationAuthorizationClientsClientsLoadBalancerLoadBalancerReal TimeSpecification 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',
Specification for adding, validating and generating custom domainsand SSL certificates for the Appwrite API.
Specification for adding, executing and managing custom, user supplied cloud functions.