Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2021-03-29 10:01:12 +0300
committerGitHub <noreply@github.com>2021-03-29 10:01:12 +0300
commit602de272c09ae6e11193cd19fbeea2f7e9d908e3 (patch)
tree2585bcb1b8b327cb66984e8c54eaa892aa7bf3e5 /build
parent4564121c5642d80ff6f6990ed5b6e46ac0901140 (diff)
parent00d83a5db056a9c466831fd45347f414bd81f3ae (diff)
Merge pull request #26243 from nextcloud/enh/noid/avatar-privacy-new-scope
Avatar privacy and new scope
Diffstat (limited to 'build')
-rw-r--r--build/integration/features/bootstrap/Provisioning.php6
-rw-r--r--build/integration/features/provisioning-v1.feature77
-rw-r--r--build/psalm-baseline.xml8
3 files changed, 89 insertions, 2 deletions
diff --git a/build/integration/features/bootstrap/Provisioning.php b/build/integration/features/bootstrap/Provisioning.php
index 0ec19f27c60..cbe11403ba8 100644
--- a/build/integration/features/bootstrap/Provisioning.php
+++ b/build/integration/features/bootstrap/Provisioning.php
@@ -157,7 +157,11 @@ trait Provisioning {
$fullUrl = $this->baseUrl . "v{$this->apiVersion}.php/cloud/users/$user";
$client = new Client();
$options = [];
- $options['auth'] = $this->adminUser;
+ if ($this->currentUser === 'admin') {
+ $options['auth'] = $this->adminUser;
+ } else {
+ $options['auth'] = [$this->currentUser, $this->regularUser];
+ }
$options['headers'] = [
'OCS-APIREQUEST' => 'true',
];
diff --git a/build/integration/features/provisioning-v1.feature b/build/integration/features/provisioning-v1.feature
index 717aa04e4bd..03aaad4b857 100644
--- a/build/integration/features/provisioning-v1.feature
+++ b/build/integration/features/provisioning-v1.feature
@@ -103,6 +103,82 @@ Feature: provisioning
| website | https://nextcloud.com |
| twitter | Nextcloud |
+ Scenario: Edit a user account properties scopes
+ Given user "brand-new-user" exists
+ And As an "brand-new-user"
+ When sending "PUT" to "/cloud/users/brand-new-user" with
+ | key | phoneScope |
+ | value | v2-private |
+ Then the OCS status code should be "100"
+ And the HTTP status code should be "200"
+ When sending "PUT" to "/cloud/users/brand-new-user" with
+ | key | twitterScope |
+ | value | v2-local |
+ Then the OCS status code should be "100"
+ And the HTTP status code should be "200"
+ When sending "PUT" to "/cloud/users/brand-new-user" with
+ | key | addressScope |
+ | value | v2-federated |
+ Then the OCS status code should be "100"
+ And the HTTP status code should be "200"
+ When sending "PUT" to "/cloud/users/brand-new-user" with
+ | key | emailScope |
+ | value | v2-published |
+ Then the OCS status code should be "100"
+ And the HTTP status code should be "200"
+ When sending "PUT" to "/cloud/users/brand-new-user" with
+ | key | websiteScope |
+ | value | public |
+ Then the OCS status code should be "100"
+ And the HTTP status code should be "200"
+ When sending "PUT" to "/cloud/users/brand-new-user" with
+ | key | displaynameScope |
+ | value | contacts |
+ Then the OCS status code should be "100"
+ And the HTTP status code should be "200"
+ When sending "PUT" to "/cloud/users/brand-new-user" with
+ | key | avatarScope |
+ | value | private |
+ Then the OCS status code should be "100"
+ And the HTTP status code should be "200"
+ Then user "brand-new-user" has
+ | id | brand-new-user |
+ | phoneScope | v2-private |
+ | twitterScope | v2-local |
+ | addressScope | v2-federated |
+ | emailScope | v2-published |
+ | websiteScope | v2-published |
+ | displaynameScope | v2-federated |
+ | avatarScope | v2-local |
+
+ Scenario: Edit a user account properties scopes with invalid or unsupported value
+ Given user "brand-new-user" exists
+ And As an "brand-new-user"
+ When sending "PUT" to "/cloud/users/brand-new-user" with
+ | key | phoneScope |
+ | value | invalid |
+ Then the OCS status code should be "102"
+ And the HTTP status code should be "200"
+ When sending "PUT" to "/cloud/users/brand-new-user" with
+ | key | displaynameScope |
+ | value | v2-private |
+ Then the OCS status code should be "102"
+ And the HTTP status code should be "200"
+ When sending "PUT" to "/cloud/users/brand-new-user" with
+ | key | emailScope |
+ | value | v2-private |
+ Then the OCS status code should be "102"
+ And the HTTP status code should be "200"
+
+ Scenario: An admin cannot edit user account property scopes
+ Given As an "admin"
+ And user "brand-new-user" exists
+ When sending "PUT" to "/cloud/users/brand-new-user" with
+ | key | phoneScope |
+ | value | v2-private |
+ Then the OCS status code should be "997"
+ And the HTTP status code should be "401"
+
Scenario: Search by phone number
Given As an "admin"
And user "phone-user" exists
@@ -612,4 +688,3 @@ Feature: provisioning
And As an "user0"
When sending "GET" with exact url to "/index.php/apps/files"
And the HTTP status code should be "403"
-
diff --git a/build/psalm-baseline.xml b/build/psalm-baseline.xml
index 7efe87903da..feabe34ecfa 100644
--- a/build/psalm-baseline.xml
+++ b/build/psalm-baseline.xml
@@ -2981,6 +2981,14 @@
<code>InMemoryFile</code>
</ImplementedReturnTypeMismatch>
</file>
+ <file src="lib/private/Avatar/PlaceholderAvatar.php">
+ <ImplementedReturnTypeMismatch occurrences="1">
+ <code>ISimpleFile</code>
+ </ImplementedReturnTypeMismatch>
+ <InvalidScalarArgument occurrences="1">
+ <code>$data</code>
+ </InvalidScalarArgument>
+ </file>
<file src="lib/private/Avatar/UserAvatar.php">
<ImplementedReturnTypeMismatch occurrences="1">
<code>ISimpleFile</code>