From b51ba47e0174ad5ddb71203b02f652710fbba492 Mon Sep 17 00:00:00 2001 From: Viktor Scharf Date: Wed, 17 Apr 2024 11:42:09 +0200 Subject: [PATCH] check email in the search sharee request (#8861) --- tests/acceptance/config/behat-core.yml | 1 + .../apiGraphUserGroup/getUser.feature | 1965 +++++++++-------- .../searchUserIncludingEmail.feature | 21 +- .../features/bootstrap/GraphContext.php | 23 + .../features/bootstrap/ShareesContext.php | 8 +- .../features/coreApiSharees/sharees.feature | 70 +- 6 files changed, 1087 insertions(+), 1001 deletions(-) diff --git a/tests/acceptance/config/behat-core.yml b/tests/acceptance/config/behat-core.yml index 3808e0a13f..7e99da03bd 100644 --- a/tests/acceptance/config/behat-core.yml +++ b/tests/acceptance/config/behat-core.yml @@ -78,6 +78,7 @@ default: contexts: - FeatureContext: *common_feature_context_params - ShareesContext: + - OcisConfigContext: coreApiShareManagementToShares: paths: diff --git a/tests/acceptance/features/apiGraphUserGroup/getUser.feature b/tests/acceptance/features/apiGraphUserGroup/getUser.feature index 6ea03ea659..92cb435406 100644 --- a/tests/acceptance/features/apiGraphUserGroup/getUser.feature +++ b/tests/acceptance/features/apiGraphUserGroup/getUser.feature @@ -15,40 +15,40 @@ Feature: get users When user "Alice" gets information of user "Brian" using Graph API Then the HTTP status code should be "200" And the JSON data of the response should match - """ - { - "type": "object", - "required": [ - "displayName", - "id", - "onPremisesSamAccountName", - "accountEnabled", - "userType" - ], - "properties": { - "displayName": { - "type": "string", - "enum": ["Brian Murphy"] - }, - "id" : { - "type": "string", - "pattern": "^%user_id_pattern%$" - }, - "onPremisesSamAccountName": { - "type": "string", - "enum": ["Brian"] - }, - "accountEnabled": { - "type": "boolean", - "enum": [true] - }, - "userType": { - "type": "string", - "enum": ["Member"] + """ + { + "type": "object", + "required": [ + "displayName", + "id", + "onPremisesSamAccountName", + "accountEnabled", + "userType" + ], + "properties": { + "displayName": { + "type": "string", + "const": "Brian Murphy" + }, + "id": { + "type": "string", + "pattern": "^%user_id_pattern%$" + }, + "onPremisesSamAccountName": { + "type": "string", + "const": "Brian" + }, + "accountEnabled": { + "type": "boolean", + "const": true + }, + "userType": { + "type": "string", + "const": "Member" + } } } - } - """ + """ @issue-5125 Scenario Outline: non-admin user tries to get the information of a user @@ -57,28 +57,28 @@ Feature: get users When user "Brian" tries to get information of user "Alice" using Graph API Then the HTTP status code should be "401" And the JSON data of the response should match - """ - { - "type": "object", - "required": [ - "error" - ], - "properties": { - "error": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message":{ - "type": "string", - "enum": ["Unauthorized"] + """ + { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string", + "const": "Unauthorized" + } } } } } - } - """ + """ Examples: | user-role | user-role-2 | | Space Admin | Space Admin | @@ -100,75 +100,75 @@ Feature: get users When user "Alice" gets all users using the Graph API Then the HTTP status code should be "200" And the JSON data of the response should contain the user "Alice Hansen" in the item 'value', the user-details should match - """ - { - "type": "object", - "required": [ - "id", - "mail", - "onPremisesSamAccountName", - "accountEnabled", - "userType" - ], - "properties": { - "id" : { - "type": "string", - "pattern": "^%user_id_pattern%$" - }, - "mail": { - "type": "string", - "enum": ["alice@example.org"] - }, - "onPremisesSamAccountName": { - "type": "string", - "enum": ["Alice"] - }, - "accountEnabled": { - "type": "boolean", - "enum": [true] - }, - "userType": { - "type": "string", - "enum": ["Member"] + """ + { + "type": "object", + "required": [ + "id", + "mail", + "onPremisesSamAccountName", + "accountEnabled", + "userType" + ], + "properties": { + "id": { + "type": "string", + "pattern": "^%user_id_pattern%$" + }, + "mail": { + "type": "string", + "const": "alice@example.org" + }, + "onPremisesSamAccountName": { + "type": "string", + "const": "Alice" + }, + "accountEnabled": { + "type": "boolean", + "const": true + }, + "userType": { + "type": "string", + "const": "Member" + } } } - } - """ + """ And the JSON data of the response should contain the user "Brian Murphy" in the item 'value', the user-details should match - """ - { - "type": "object", - "required": [ - "id", - "mail", - "onPremisesSamAccountName", - "accountEnabled", - "userType" - ], - "properties": { - "id" : { - "type": "string", - "pattern": "^%user_id_pattern%$" - }, - "mail": { - "type": "string", - "enum": ["brian@example.org"] - }, - "onPremisesSamAccountName": { - "type": "string", - "enum": ["Brian"] - }, - "accountEnabled": { - "type": "boolean", - "enum": [true] - }, - "userType": { - "type": "string", - "enum": ["Member"] + """ + { + "type": "object", + "required": [ + "id", + "mail", + "onPremisesSamAccountName", + "accountEnabled", + "userType" + ], + "properties": { + "id": { + "type": "string", + "pattern": "^%user_id_pattern%$" + }, + "mail": { + "type": "string", + "const": "brian@example.org" + }, + "onPremisesSamAccountName": { + "type": "string", + "const": "Brian" + }, + "accountEnabled": { + "type": "boolean", + "const": true + }, + "userType": { + "type": "string", + "const": "Member" + } } } - } - """ + """ Scenario: admin user gets all users include disabled users @@ -177,75 +177,75 @@ Feature: get users When user "Alice" gets all users using the Graph API Then the HTTP status code should be "200" And the JSON data of the response should contain the user "Alice Hansen" in the item 'value', the user-details should match - """ - { - "type": "object", - "required": [ - "id", - "mail", - "onPremisesSamAccountName", - "accountEnabled", - "userType" - ], - "properties": { - "id" : { - "type": "string", - "pattern": "^%user_id_pattern%$" - }, - "mail": { - "type": "string", - "enum": ["alice@example.org"] - }, - "onPremisesSamAccountName": { - "type": "string", - "enum": ["Alice"] - }, - "accountEnabled": { - "type": "boolean", - "enum": [true] - }, - "userType": { - "type": "string", - "enum": ["Member"] + """ + { + "type": "object", + "required": [ + "id", + "mail", + "onPremisesSamAccountName", + "accountEnabled", + "userType" + ], + "properties": { + "id": { + "type": "string", + "pattern": "^%user_id_pattern%$" + }, + "mail": { + "type": "string", + "const": "alice@example.org" + }, + "onPremisesSamAccountName": { + "type": "string", + "const": "Alice" + }, + "accountEnabled": { + "type": "boolean", + "const": true + }, + "userType": { + "type": "string", + "const": "Member" + } } } - } - """ + """ And the JSON data of the response should contain the user "Brian Murphy" in the item 'value', the user-details should match - """ - { - "type": "object", - "required": [ - "id", - "mail", - "onPremisesSamAccountName", - "accountEnabled", - "userType" - ], - "properties": { - "id" : { - "type": "string", - "pattern": "^%user_id_pattern%$" - }, - "mail": { - "type": "string", - "enum": ["brian@example.org"] - }, - "onPremisesSamAccountName": { - "type": "string", - "enum": ["Brian"] - }, - "accountEnabled": { - "type": "boolean", - "enum": [false] - }, - "userType": { - "type": "string", - "enum": ["Member"] + """ + { + "type": "object", + "required": [ + "id", + "mail", + "onPremisesSamAccountName", + "accountEnabled", + "userType" + ], + "properties": { + "id": { + "type": "string", + "pattern": "^%user_id_pattern%$" + }, + "mail": { + "type": "string", + "const": "brian@example.org" + }, + "onPremisesSamAccountName": { + "type": "string", + "const": "Brian" + }, + "accountEnabled": { + "type": "boolean", + "const": false + }, + "userType": { + "type": "string", + "const": "Member" + } } } - } - """ + """ Scenario Outline: non-admin user tries to get all users @@ -253,28 +253,28 @@ Feature: get users When user "Brian" tries to get all users using the Graph API Then the HTTP status code should be "403" And the JSON data of the response should match - """ - { - "type": "object", - "required": [ - "error" - ], - "properties": { - "error": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string", - "enum": ["search term too short"] + """ + { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string", + "const": "search term too short" + } } } } } - } - """ + """ Examples: | user-role | | Space Admin | @@ -287,7 +287,7 @@ Feature: get users When the user "Alice" gets user "Brian" along with his drive information using Graph API Then the HTTP status code should be "200" And the JSON data of the response should match - """ + """ { "type": "object", "required": [ @@ -301,23 +301,23 @@ Feature: get users "properties": { "displayName": { "type": "string", - "enum": ["Brian Murphy"] + "const": "Brian Murphy" }, - "id" : { + "id": { "type": "string", "pattern": "^%user_id_pattern%$" }, "onPremisesSamAccountName": { "type": "string", - "enum": ["Brian"] + "const": "Brian" }, "accountEnabled": { "type": "boolean", - "enum": [true] + "const": true }, "userType": { "type": "string", - "enum": ["Member"] + "const": "Member" }, "drive": { "type": "object", @@ -331,21 +331,21 @@ Feature: get users "webUrl" ], "properties": { - "driveType" : { + "driveType": { "type": "string", - "enum": ["personal"] + "const": "personal" }, - "driveAlias" : { + "driveAlias": { "type": "string", - "enum": ["personal/brian"] + "const": "personal/brian" }, - "id" : { + "id": { "type": "string", "pattern": "^%space_id_pattern%$" }, "name": { "type": "string", - "enum": ["Brian Murphy"] + "const": "Brian Murphy" }, "owner": { "type": "object", @@ -375,7 +375,7 @@ Feature: get users "properties": { "state": { "type": "string", - "enum": ["normal"] + "const": "normal" } } }, @@ -388,7 +388,7 @@ Feature: get users "properties": { "state": { "type": "string", - "enum": ["normal"] + "const": "normal" }, "webDavUrl": { "type": "string", @@ -404,7 +404,7 @@ Feature: get users } } } - """ + """ Scenario Outline: user gets his/her own information along with drive information @@ -412,7 +412,7 @@ Feature: get users When the user "Brian" gets his drive information using Graph API Then the HTTP status code should be "200" And the JSON data of the response should match - """ + """ { "type": "object", "required": [ @@ -426,23 +426,23 @@ Feature: get users "properties": { "displayName": { "type": "string", - "enum": ["Brian Murphy"] + "const": "Brian Murphy" }, - "id" : { + "id": { "type": "string", "pattern": "^%user_id_pattern%$" }, "onPremisesSamAccountName": { "type": "string", - "enum": ["Brian"] + "const": "Brian" }, "accountEnabled": { "type": "boolean", - "enum": [true] + "const": true }, "userType": { "type": "string", - "enum": ["Member"] + "const": "Member" }, "drive": { "type": "object", @@ -456,21 +456,21 @@ Feature: get users "webUrl" ], "properties": { - "driveType" : { + "driveType": { "type": "string", - "enum": ["personal"] + "const": "personal" }, - "driveAlias" : { + "driveAlias": { "type": "string", - "enum": ["personal/brian"] + "const": "personal/brian" }, - "id" : { + "id": { "type": "string", "pattern": "^%space_id_pattern%$" }, "name": { "type": "string", - "enum": ["Brian Murphy"] + "const": "Brian Murphy" }, "owner": { "type": "object", @@ -500,7 +500,7 @@ Feature: get users "properties": { "state": { "type": "string", - "enum": ["normal"] + "const": "normal" } } }, @@ -513,7 +513,7 @@ Feature: get users "properties": { "state": { "type": "string", - "enum": ["normal"] + "const": "normal" }, "webDavUrl": { "type": "string", @@ -529,7 +529,7 @@ Feature: get users } } } - """ + """ Examples: | user-role | | Admin | @@ -547,59 +547,59 @@ Feature: get users When the user "Alice" gets user "Brian" along with his group information using Graph API Then the HTTP status code should be "200" And the JSON data of the response should match - """ - { - "type": "object", - "required": [ - "id", - "onPremisesSamAccountName" - ], - "properties": { - "id" : { - "type": "string", - "pattern": "^%user_id_pattern%$" - }, - "onPremisesSamAccountName": { - "type": "string", - "enum": ["Brian"] - }, - "memberOf": { - "type": "array", - "minItems": 2, - "maxItems": 2, - "uniqueItems": true, - "items": { - "oneOf": [ - { - "type": "object", - "required": [ - "displayName" - ], - "properties": { - "displayName": { - "type": "string", - "enum": ["tea-lover"] + """ + { + "type": "object", + "required": [ + "id", + "onPremisesSamAccountName" + ], + "properties": { + "id": { + "type": "string", + "pattern": "^%user_id_pattern%$" + }, + "onPremisesSamAccountName": { + "type": "string", + "const": "Brian" + }, + "memberOf": { + "type": "array", + "minItems": 2, + "maxItems": 2, + "uniqueItems": true, + "items": { + "oneOf": [ + { + "type": "object", + "required": [ + "displayName" + ], + "properties": { + "displayName": { + "type": "string", + "const": "tea-lover" + } + } + }, + { + "type": "object", + "required": [ + "displayName" + ], + "properties": { + "displayName": { + "type": "string", + "const": "coffee-lover" + } } } - }, - { - "type": "object", - "required": [ - "displayName" - ], - "properties": { - "displayName": { - "type": "string", - "enum": ["coffee-lover"] - } - } - } - ] + ] + } } } } - } - """ + """ @issue-5125 Scenario Outline: non-admin user tries to get the group information of a user @@ -610,28 +610,28 @@ Feature: get users When the user "Alice" gets user "Brian" along with his group information using Graph API Then the HTTP status code should be "401" And the JSON data of the response should match - """ - { - "type": "object", - "required": [ - "error" - ], - "properties": { - "error": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message: { - "type": "string", - "enum": ["Unauthorized"] + """ + { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string", + "const": "Unauthorized" + } } } } } - } - """ + """ Examples: | user-role | user-role-2 | | Space Admin | Space Admin | @@ -660,140 +660,140 @@ Feature: get users When the user "Alice" gets all users of the group "tea-lover" using the Graph API Then the HTTP status code should be "200" And the JSON data of the response should match - """ - { - "type": "object", - "required": [ - "value" - ], - "properties": { - "value": { - "type": "array", - "minItems": 2, - "maxItems": 2, - "uniqueItems": true, - "items": { - "oneOf": [ - { - "type": "object", - "required": [ - "id", - "mail", - "onPremisesSamAccountName", - "accountEnabled", - "userType" - ], - "properties": { - "id" : { - "type": "string", - "pattern": "^%user_id_pattern%$" - }, - "mail": { - "type": "string", - "enum": ["alice@example.org"] - }, - "onPremisesSamAccountName": { - "type": "string", - "enum": ["Alice"] - }, - "accountEnabled": { - "type": "boolean", - "enum": [true] - }, - "userType": { - "type": "string", - "enum": ["Member"] + """ + { + "type": "object", + "required": [ + "value" + ], + "properties": { + "value": { + "type": "array", + "minItems": 2, + "maxItems": 2, + "uniqueItems": true, + "items": { + "oneOf": [ + { + "type": "object", + "required": [ + "id", + "mail", + "onPremisesSamAccountName", + "accountEnabled", + "userType" + ], + "properties": { + "id": { + "type": "string", + "pattern": "^%user_id_pattern%$" + }, + "mail": { + "type": "string", + "const": "alice@example.org" + }, + "onPremisesSamAccountName": { + "type": "string", + "const": "Alice" + }, + "accountEnabled": { + "type": "boolean", + "const": true + }, + "userType": { + "type": "string", + "const": "Member" + } + } + }, + { + "type": "object", + "required": [ + "id", + "mail", + "onPremisesSamAccountName", + "accountEnabled" + ], + "properties": { + "id": { + "type": "string", + "pattern": "^%user_id_pattern%$" + }, + "mail": { + "type": "string", + "const": "brian@example.org" + }, + "onPremisesSamAccountName": { + "type": "string", + "const": "Brian" + }, + "accountEnabled": { + "type": "boolean", + "const": true + }, + "userType": { + "type": "string", + "const": "Member" + } } } - }, - { - "type": "object", - "required": [ - "id", - "mail", - "onPremisesSamAccountName", - "accountEnabled" - ], - "properties": { - "id" : { - "type": "string", - "pattern": "^%user_id_pattern%$" - }, - "mail": { - "type": "string", - "enum": ["brian@example.org"] - }, - "onPremisesSamAccountName": { - "type": "string", - "enum": ["Brian"] - }, - "accountEnabled": { - "type": "boolean", - "enum": [true] - }, - "userType": { - "type": "string", - "enum": ["Member"] - } - } - } - ] + ] + } } } } - } - """ + """ And the JSON data of the response should not contain the user "Carol King" in the item 'value' When the user "Alice" gets all users of two groups "tea-lover,coffee-lover" using the Graph API Then the HTTP status code should be "200" And the JSON data of the response should match - """ - { - "type": "object", - "required": [ - "value" - ], - "properties": { - "value": { - "type": "array", - "minItems": 1, - "maxItems": 1, - "items": { - "type": "object", - "required": [ - "id", - "mail", - "onPremisesSamAccountName", - "accountEnabled", - "userType" - ], - "properties": { - "id" : { - "type": "string", - "pattern": "^%user_id_pattern%$" - }, - "mail": { - "type": "string", - "enum": ["brian@example.org"] - }, - "onPremisesSamAccountName": { - "type": "string", - "enum": ["Brian"] - }, - "accountEnabled": { - "type": "boolean", - "enum": [true] - }, - "userType": { - "type": "string", - "enum": ["Member"] + """ + { + "type": "object", + "required": [ + "value" + ], + "properties": { + "value": { + "type": "array", + "minItems": 1, + "maxItems": 1, + "items": { + "type": "object", + "required": [ + "id", + "mail", + "onPremisesSamAccountName", + "accountEnabled", + "userType" + ], + "properties": { + "id": { + "type": "string", + "pattern": "^%user_id_pattern%$" + }, + "mail": { + "type": "string", + "const": "brian@example.org" + }, + "onPremisesSamAccountName": { + "type": "string", + "const": "Brian" + }, + "accountEnabled": { + "type": "boolean", + "const": true + }, + "userType": { + "type": "string", + "const": "Member" + } } } } } } - } - """ + """ And the JSON data of the response should not contain the user "Carol King" in the item 'value' And the JSON data of the response should not contain the user "Alice Hansen" in the item 'value' @@ -810,75 +810,75 @@ Feature: get users When the user "Alice" gets all users that are members in the group "tea-lover" or the group "coffee-lover" using the Graph API Then the HTTP status code should be "200" And the JSON data of the response should contain the user "Alice Hansen" in the item 'value', the user-details should match - """ - { - "type": "object", - "required": [ - "id", - "mail", - "onPremisesSamAccountName", - "accountEnabled", - "userType" - ], - "properties": { - "id" : { - "type": "string", - "pattern": "^%user_id_pattern%$" - }, - "mail": { - "type": "string", - "enum": ["alice@example.org"] - }, - "onPremisesSamAccountName": { - "type": "string", - "enum": ["Alice"] - }, - "accountEnabled": { - "type": "boolean", - "enum": [true] - }, - "userType": { - "type": "string", - "enum": ["Member"] + """ + { + "type": "object", + "required": [ + "id", + "mail", + "onPremisesSamAccountName", + "accountEnabled", + "userType" + ], + "properties": { + "id": { + "type": "string", + "pattern": "^%user_id_pattern%$" + }, + "mail": { + "type": "string", + "const": "alice@example.org" + }, + "onPremisesSamAccountName": { + "type": "string", + "const": "Alice" + }, + "accountEnabled": { + "type": "boolean", + "const": true + }, + "userType": { + "type": "string", + "const": "Member" + } } } - } - """ + """ And the JSON data of the response should contain the user "Brian Murphy" in the item 'value', the user-details should match - """ - { - "type": "object", - "required": [ - "id", - "mail", - "onPremisesSamAccountName", - "accountEnabled", - "userType" - ], - "properties": { - "id" : { - "type": "string", - "pattern": "^%user_id_pattern%$" - }, - "mail": { - "type": "string", - "enum": ["brian@example.org"] - }, - "onPremisesSamAccountName": { - "type": "string", - "enum": ["Brian"] - }, - "accountEnabled": { - "type": "boolean", - "enum": [true] - }, - "userType": { - "type": "string", - "enum": ["Member"] + """ + { + "type": "object", + "required": [ + "id", + "mail", + "onPremisesSamAccountName", + "accountEnabled", + "userType" + ], + "properties": { + "id": { + "type": "string", + "pattern": "^%user_id_pattern%$" + }, + "mail": { + "type": "string", + "const": "brian@example.org" + }, + "onPremisesSamAccountName": { + "type": "string", + "const": "Brian" + }, + "accountEnabled": { + "type": "boolean", + "const": true + }, + "userType": { + "type": "string", + "const": "Member" + } } } - } - """ + """ But the JSON data of the response should not contain the user "Carol King" in the item 'value' @@ -890,28 +890,28 @@ Feature: get users When the user "Brian" gets all users of the group "tea-lover" using the Graph API Then the HTTP status code should be "403" And the JSON data of the response should match - """ - { - "type": "object", - "required": [ - "error" - ], - "properties": { - "error": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string", - "enum": ["search term too short"] + """ + { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string", + "const": "search term too short" + } } } } } - } - """ + """ Examples: | user-role | | Space Admin | @@ -929,113 +929,113 @@ Feature: get users When the user "Alice" gets all users with role "Space Admin" using the Graph API Then the HTTP status code should be "200" And the JSON data of the response should contain the user "Brian Murphy" in the item 'value', the user-details should match - """ - { - "type": "object", - "required": [ - "id", - "mail", - "onPremisesSamAccountName", - "accountEnabled", - "userType" - ], - "properties": { - "id" : { - "type": "string", - "pattern": "^%user_id_pattern%$" - }, - "mail": { - "type": "string", - "enum": ["brian@example.org"] - }, - "onPremisesSamAccountName": { - "type": "string", - "enum": ["Brian"] - }, - "accountEnabled": { - "type": "boolean", - "enum": [true] - }, - "userType": { - "type": "string", - "enum": ["Member"] + """ + { + "type": "object", + "required": [ + "id", + "mail", + "onPremisesSamAccountName", + "accountEnabled", + "userType" + ], + "properties": { + "id": { + "type": "string", + "pattern": "^%user_id_pattern%$" + }, + "mail": { + "type": "string", + "const": "brian@example.org" + }, + "onPremisesSamAccountName": { + "type": "string", + "const": "Brian" + }, + "accountEnabled": { + "type": "boolean", + "const": true + }, + "userType": { + "type": "string", + "const": "Member" + } } } - } - """ + """ And the JSON data of the response should contain the user "Carol King" in the item 'value', the user-details should match - """ - { - "type": "object", - "required": [ - "id", - "mail", - "onPremisesSamAccountName", - "accountEnabled", - "userType" - ], - "properties": { - "id" : { - "type": "string", - "pattern": "^%user_id_pattern%$" - }, - "mail": { - "type": "string", - "enum": ["carol@example.org"] - }, - "onPremisesSamAccountName": { - "type": "string", - "enum": ["Carol"] - }, - "accountEnabled": { - "type": "boolean", - "enum": [true] - }, - "userType": { - "type": "string", - "enum": ["Member"] + """ + { + "type": "object", + "required": [ + "id", + "mail", + "onPremisesSamAccountName", + "accountEnabled", + "userType" + ], + "properties": { + "id": { + "type": "string", + "pattern": "^%user_id_pattern%$" + }, + "mail": { + "type": "string", + "const": "carol@example.org" + }, + "onPremisesSamAccountName": { + "type": "string", + "const": "Carol" + }, + "accountEnabled": { + "type": "boolean", + "const": true + }, + "userType": { + "type": "string", + "const": "Member" + } } } - } - """ + """ But the JSON data of the response should not contain the user "Alice Hansen" in the item 'value' When the user "Alice" gets all users with role "Space Admin" and member of the group "tea-lover" using the Graph API Then the HTTP status code should be "200" And the JSON data of the response should contain the user "Brian Murphy" in the item 'value', the user-details should match - """ - { - "type": "object", - "required": [ - "id", - "mail", - "onPremisesSamAccountName", - "accountEnabled", - "userType" - ], - "properties": { - "id" : { - "type": "string", - "pattern": "^%user_id_pattern%$" - }, - "mail": { - "type": "string", - "enum": ["brian@example.org"] - }, - "onPremisesSamAccountName": { - "type": "string", - "enum": ["Brian"] - }, - "accountEnabled": { - "type": "boolean", - "enum": [true] - }, - "userType": { - "type": "string", - "enum": ["Member"] + """ + { + "type": "object", + "required": [ + "id", + "mail", + "onPremisesSamAccountName", + "accountEnabled", + "userType" + ], + "properties": { + "id": { + "type": "string", + "pattern": "^%user_id_pattern%$" + }, + "mail": { + "type": "string", + "const": "brian@example.org" + }, + "onPremisesSamAccountName": { + "type": "string", + "const": "Brian" + }, + "accountEnabled": { + "type": "boolean", + "const": true + }, + "userType": { + "type": "string", + "const": "Member" + } } } - } - """ + """ But the JSON data of the response should not contain the user "Carol King" in the item 'value' @@ -1044,28 +1044,28 @@ Feature: get users When the user "Alice" gets all users with role "" using the Graph API Then the HTTP status code should be "403" And the JSON data of the response should match - """ - { - "type": "object", - "required": [ - "error" - ], - "properties": { - "error": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string", - "enum": ["search term too short"] + """ + { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string", + "const": "search term too short" + } } } } } - } - """ + """ Examples: | user-role | user-role-2 | | Space Admin | Space Admin | @@ -1089,92 +1089,92 @@ Feature: get users When user "Alice" gets the personal drive information of user "Brian" using Graph API Then the HTTP status code should be "200" And the JSON data of the response should match - """ - { - "type": "object", - "required": [ - "driveAlias", - "driveType", - "id", - "name", - "webUrl", - "owner", - "quota", - "root" - ], - "properties": { - "driveAlias": { - "type": "string", - "enum": ["personal/brian"] - }, - "driveType": { - "type": "string", - "enum": ["personal"] - }, - "id": { - "type": "string", - "pattern": "^%space_id_pattern%$" - }, - "name": { - "type": "string", - "enum": ["Brian Murphy"] - }, - "webUrl": { - "type": "string", - "pattern": "^%base_url%/f/%space_id_pattern%$" - }, - "owner": { - "type": "object", - "required": [ - "user" - ], - "properties": { - "user": { - "type": "object", - "required": [ - "displayName", - "id" - ], - "properties": { - "displayName": { - "type": "string", - "enum": [""] - }, - "id": { - "type": "string", - "pattern": "^%user_id_pattern%$" + """ + { + "type": "object", + "required": [ + "driveAlias", + "driveType", + "id", + "name", + "webUrl", + "owner", + "quota", + "root" + ], + "properties": { + "driveAlias": { + "type": "string", + "const": "personal/brian" + }, + "driveType": { + "type": "string", + "const": "personal" + }, + "id": { + "type": "string", + "pattern": "^%space_id_pattern%$" + }, + "name": { + "type": "string", + "const": "Brian Murphy" + }, + "webUrl": { + "type": "string", + "pattern": "^%base_url%/f/%space_id_pattern%$" + }, + "owner": { + "type": "object", + "required": [ + "user" + ], + "properties": { + "user": { + "type": "object", + "required": [ + "displayName", + "id" + ], + "properties": { + "displayName": { + "type": "string", + "const": "" + }, + "id": { + "type": "string", + "pattern": "^%user_id_pattern%$" + } } } } - } - }, - "qouta": { - "type": "object", - "required": [ - "state" - ], - "properties": { - "state": { - "type": "string", - "enum": ["normal"] + }, + "qouta": { + "type": "object", + "required": [ + "state" + ], + "properties": { + "state": { + "type": "string", + "const": "normal" + } } - } - }, - "root": { - "type": "object", - "required": [ - "webDavUrl" - ], - "properties": { - "webDavUrl": { - "type": "string", - "pattern": "^%base_url%/dav/spaces/%space_id_pattern%$" + }, + "root": { + "type": "object", + "required": [ + "webDavUrl" + ], + "properties": { + "webDavUrl": { + "type": "string", + "pattern": "^%base_url%/dav/spaces/%space_id_pattern%$" + } } } } } - } - """ + """ Examples: | user-role | user-role-2 | | Admin | Admin | @@ -1193,33 +1193,33 @@ Feature: get users When user "Alice" gets the personal drive information of user "Brian" using Graph API Then the HTTP status code should be "404" And the JSON data of the response should match - """ - { - "type": "object", - "required": [ - "error" - ], - "properties": { - "error": { - "type": "object", - "required": [ - "code", - "message" - ], - "properties": { - "code": { - "type": "string", - "enum": ["itemNotFound"] - }, - "message": { - "type": "string", - "enum": ["no drive returned from storage"] + """ + { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "string", + "const": "itemNotFound" + }, + "message": { + "type": "string", + "const": "no drive returned from storage" + } } } } } - } - """ + """ Examples: | user-role | user-role-2 | | User | Admin | @@ -1237,92 +1237,92 @@ Feature: get users When user "Alice" gets own personal drive information using Graph API Then the HTTP status code should be "200" And the JSON data of the response should match - """ - { - "type": "object", - "required": [ - "driveAlias", - "driveType", - "id", - "name", - "webUrl", - "owner", - "quota", - "root" - ], - "properties": { - "driveAlias": { - "type": "string", - "enum": ["personal/alice"] - }, - "driveType": { - "type": "string", - "enum": ["personal"] - }, - "id": { - "type": "string", - "pattern": "^%space_id_pattern%$" - }, - "name": { - "type": "string", - "enum": ["Alice Hansen"] - }, - "webUrl": { - "type": "string", - "pattern": "^%base_url%/f/%space_id_pattern%$" - }, - "owner": { - "type": "object", - "required": [ - "user" - ], - "properties": { - "user": { - "type": "object", - "required": [ - "displayName", - "id" - ], - "properties": { - "displayName": { - "type": "string", - "enum": [""] - }, - "id": { - "type": "string", - "pattern": "^%user_id_pattern%$" + """ + { + "type": "object", + "required": [ + "driveAlias", + "driveType", + "id", + "name", + "webUrl", + "owner", + "quota", + "root" + ], + "properties": { + "driveAlias": { + "type": "string", + "const": "personal/alice" + }, + "driveType": { + "type": "string", + "const": "personal" + }, + "id": { + "type": "string", + "pattern": "^%space_id_pattern%$" + }, + "name": { + "type": "string", + "const": "Alice Hansen" + }, + "webUrl": { + "type": "string", + "pattern": "^%base_url%/f/%space_id_pattern%$" + }, + "owner": { + "type": "object", + "required": [ + "user" + ], + "properties": { + "user": { + "type": "object", + "required": [ + "displayName", + "id" + ], + "properties": { + "displayName": { + "type": "string", + "const": "" + }, + "id": { + "type": "string", + "pattern": "^%user_id_pattern%$" + } } } } - } - }, - "qouta": { - "type": "object", - "required": [ - "state" - ], - "properties": { - "state": { - "type": "string", - "enum": ["normal"] + }, + "qouta": { + "type": "object", + "required": [ + "state" + ], + "properties": { + "state": { + "type": "string", + "const": "normal" + } } - } - }, - "root": { - "type": "object", - "required": [ - "webDavUrl" - ], - "properties": { - "webDavUrl": { - "type": "string", - "pattern": "^%base_url%/dav/spaces/%space_id_pattern%$" + }, + "root": { + "type": "object", + "required": [ + "webDavUrl" + ], + "properties": { + "webDavUrl": { + "type": "string", + "pattern": "^%base_url%/dav/spaces/%space_id_pattern%$" + } } } } } - } - """ + """ Examples: | user-role | | Admin | @@ -1334,71 +1334,72 @@ Feature: get users Scenario: non-admin user searches other users by display name When user "Brian" searches for user "ali" using Graph API Then the HTTP status code should be "200" + And the JSON data of the search response should not contain user email And the JSON data of the response should match - """ - { - "type": "object", - "required": [ - "value" - ], - "properties": { - "value": { - "type": "array", - "minItems": 1, - "maxItems": 1, - "items": { - "type": "object", - "required": [ - "displayName", - "id", - "userType" - ], - "properties": { - "displayName": { - "type": "string", - "enum": ["Alice Hansen"] - }, - "id": { - "type": "string", - "pattern": "^%user_id_pattern%$" - }, - "userType": { - "type": "string", - "enum": ["Member"] + """ + { + "type": "object", + "required": [ + "value" + ], + "properties": { + "value": { + "type": "array", + "minItems": 1, + "maxItems": 1, + "items": { + "type": "object", + "required": [ + "displayName", + "id", + "userType" + ], + "properties": { + "displayName": { + "type": "string", + "const": "Alice Hansen" + }, + "id": { + "type": "string", + "pattern": "^%user_id_pattern%$" + }, + "userType": { + "type": "string", + "const": "Member" + } } } } } } - } - """ + """ Scenario: non-admin user tries to search for a user by display name with less than 3 characters When user "Brian" tries to search for user "al" using Graph API Then the HTTP status code should be "403" And the JSON data of the response should match - """ - { - "type": "object", - "required": [ - "error" - ], - "properties": { - "error": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string", - "enum": ["search term too short"] + """ + { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string", + "const": "search term too short" + } } } } } - } - """ + """ @issue-7990 Scenario Outline: non-admin user tries to search for a user by display name with invalid characters/token @@ -1406,28 +1407,28 @@ Feature: get users When user "Brian" tries to search for user "" using Graph API Then the HTTP status code should be "400" And the JSON data of the response should match - """ - { - "type": "object", - "required": [ - "error" - ], - "properties": { - "error": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string", - "enum": ["Token '' is invalid"] + """ + { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string", + "const": "Token '' is invalid" + } } } } } - } - """ + """ Examples: | user | error-token | | Alice-From-Wonderland | -From-Wonderland | @@ -1437,160 +1438,166 @@ Feature: get users Scenario: non-admin user searches other users by e-mail When user "Brian" searches for user "%22alice@example.org%22" using Graph API Then the HTTP status code should be "200" + And the JSON data of the search response should not contain user email And the JSON data of the response should match - """ - { - "type": "object", - "required": [ - "value" - ], - "properties": { - "value": { - "type": "array", - "minItems": 1, - "maxItems": 1, - "items": { - "type": "object", - "required": [ - "displayName", - "id", - "userType" - ], - "properties": { - "displayName": { - "type": "string", - "enum": ["Alice Hansen"] - }, - "id": { - "type": "string", - "pattern": "^%user_id_pattern%$" - }, - "userType": { - "type": "string", - "enum": ["Member"] + """ + { + "type": "object", + "required": [ + "value" + ], + "properties": { + "value": { + "type": "array", + "minItems": 1, + "maxItems": 1, + "items": { + "type": "object", + "required": [ + "displayName", + "id", + "userType" + ], + "properties": { + "displayName": { + "type": "string", + "const": "Alice Hansen" + }, + "id": { + "type": "string", + "pattern": "^%user_id_pattern%$" + }, + "userType": { + "type": "string", + "const": "Member" + } } } } } } - } - """ + """ Scenario: non-admin user searches for a disabled users Given the user "Admin" has disabled user "Alice" When user "Brian" searches for user "alice" using Graph API Then the HTTP status code should be "200" + And the JSON data of the search response should not contain user email And the JSON data of the response should match - """ - { - "type": "object", - "required": [ - "value" - ], - "properties": { - "value": { - "type": "array", - "minItems": 1, - "maxItems": 1, - "items": { - "type": "object", - "required": [ - "displayName", - "id", - "userType" - ], - "properties": { - "displayName": { - "type": "string", - "enum": ["Alice Hansen"] - }, - "id": { - "type": "string", - "pattern": "^%user_id_pattern%$" - }, - "userType": { - "type": "string", - "enum": ["Member"] + """ + { + "type": "object", + "required": [ + "value" + ], + "properties": { + "value": { + "type": "array", + "minItems": 1, + "maxItems": 1, + "items": { + "type": "object", + "required": [ + "displayName", + "id", + "userType" + ], + "properties": { + "displayName": { + "type": "string", + "const": "Alice Hansen" + }, + "id": { + "type": "string", + "pattern": "^%user_id_pattern%$" + }, + "userType": { + "type": "string", + "const": "Member" + } } } } } } - } - """ + """ Scenario: non-admin user searches for multiple users having same displayname Given the user "Admin" has created a new user with the following attributes: | userName | another-alice | - | displayName | Alice Murphy | + | displayName | Alice Hansen | | email | another-alice@example.org | | password | containsCharacters(*:!;_+-&) | + And the administrator has assigned the role "Admin" to user "Alice" using the Graph API When user "Brian" searches for user "alice" using Graph API Then the HTTP status code should be "200" + And the JSON data of the search response should not contain users email And the JSON data of the response should match - """ - { - "type": "object", - "required": [ - "value" - ], - "properties": { - "value": { - "type": "array", - "minItems": 2, - "maxItems": 2, - "uniqueItems": true, - "items": { - "oneOf": [ - { - "type": "object", - "required": [ - "displayName", - "id", - "userType" - ], - "properties": { - "displayName": { - "type": "string", - "enum": ["Alice Hansen"] - }, - "id": { - "type": "string", - "pattern": "^%user_id_pattern%$" - }, - "userType": { - "type": "string", - "enum": ["Member"] + """ + { + "type": "object", + "required": [ + "value" + ], + "properties": { + "value": { + "type": "array", + "minItems": 2, + "maxItems": 2, + "uniqueItems": true, + "items": { + "oneOf": [ + { + "type": "object", + "required": [ + "displayName", + "id", + "userType" + ], + "properties": { + "displayName": { + "type": "string", + "const": "Alice Hansen" + }, + "id": { + "type": "string", + "pattern": "^%user_id_pattern%$" + }, + "userType": { + "type": "string", + "const": "Member" + } + } + }, + { + "type": "object", + "required": [ + "displayName", + "id", + "userType" + ], + "properties": { + "displayName": { + "type": "string", + "const": "Alice Hansen" + }, + "id": { + "type": "string", + "pattern": "^%user_id_pattern%$" + }, + "userType": { + "type": "string", + "const": [ + "Admin" + ] + } } } - }, - { - "type": "object", - "required": [ - "displayName", - "id", - "userType" - ], - "properties": { - "displayName": { - "type": "string", - "enum": ["Alice Murphy"] - }, - "id": { - "type": "string", - "pattern": "^%user_id_pattern%$" - }, - "userType": { - "type": "string", - "enum": ["Member"] - } - } - } - ] + ] + } } } } - } - """ + """ diff --git a/tests/acceptance/features/apiGraphUserGroup/searchUserIncludingEmail.feature b/tests/acceptance/features/apiGraphUserGroup/searchUserIncludingEmail.feature index d54db42c03..ccd6e8e532 100644 --- a/tests/acceptance/features/apiGraphUserGroup/searchUserIncludingEmail.feature +++ b/tests/acceptance/features/apiGraphUserGroup/searchUserIncludingEmail.feature @@ -255,7 +255,8 @@ Feature: edit/search user including email | User Light | - Scenario: non-admin user searches other users by display name + Scenario Outline: non-admin user searches other users by display name + Given the administrator has assigned the role "" to user "Brian" using the Graph API When user "Brian" searches for user "ali" using Graph API Then the HTTP status code should be "200" And the JSON data of the response should match @@ -296,6 +297,11 @@ Feature: edit/search user including email } } """ + Examples: + | user-role | + | Space Admin | + | User | + | User Light | @issue-7990 Scenario: non-admin user searches other users by e-mail @@ -460,3 +466,16 @@ Feature: edit/search user including email } } """ + + + Scenario Outline: search other users when OCIS_SHOW_USER_EMAIL_IN_RESULTS config is disabled + Given the config "OCIS_SHOW_USER_EMAIL_IN_RESULTS" has been set to "false" + And the administrator has assigned the role "" to user "Alice" using the Graph API + When user "Alice" searches for user "Brian" using Graph API + Then the HTTP status code should be "200" + And the JSON data of the search response should not contain user email + Examples: + | user-role | + | Space Admin | + | User | + | User Light | diff --git a/tests/acceptance/features/bootstrap/GraphContext.php b/tests/acceptance/features/bootstrap/GraphContext.php index d6acda481c..2d06a49d69 100644 --- a/tests/acceptance/features/bootstrap/GraphContext.php +++ b/tests/acceptance/features/bootstrap/GraphContext.php @@ -2624,4 +2624,27 @@ class GraphContext implements Context { $this->featureContext->getJSONSchema($schemaString) ); } + + /** + * @Then the JSON data of the search response should not contain user(s) email + * + * @return void + * @throws Exception + */ + public function theJsonDataResponseShouldNotContainUserEmail(): void { + $responseBody = $this->featureContext->getJsonDecodedResponseBodyContent()->value; + $mailValueExist = false; + $email = ""; + foreach ($responseBody as $value) { + if (isset($value->mail)) { + $mailValueExist = true; + $email = $value->mail; + break; + } + } + Assert::assertFalse( + $mailValueExist, + "Response contains email '$email' but should not." + ); + } } diff --git a/tests/acceptance/features/bootstrap/ShareesContext.php b/tests/acceptance/features/bootstrap/ShareesContext.php index 25c31bfb9b..d02fdf16fc 100644 --- a/tests/acceptance/features/bootstrap/ShareesContext.php +++ b/tests/acceptance/features/bootstrap/ShareesContext.php @@ -90,7 +90,7 @@ class ShareesContext implements Context { * @throws Exception */ public function theShareesReturnedShouldBe(string $shareeType, TableNode $shareesList):void { - $this->featureContext->verifyTableNodeColumnsCount($shareesList, 3); + $this->featureContext->verifyTableNodeColumnsCount($shareesList, 4); $sharees = $shareesList->getRows(); $respondedArray = $this->getArrayOfShareesResponded( $this->featureContext->getResponse(), @@ -186,14 +186,16 @@ class ShareesContext implements Context { $sharees[] = [ $innerItem['label'], $innerItem['value']['shareType'], - $innerItem['value']['shareWith'] + $innerItem['value']['shareWith'], + $innerItem['value']['shareWithAdditionalInfo'] ]; } } else { $sharees[] = [ $element['label'], $element['value']['shareType'], - $element['value']['shareWith'] + $element['value']['shareWith'], + $element['value']['shareWithAdditionalInfo'] ]; } } diff --git a/tests/acceptance/features/coreApiSharees/sharees.feature b/tests/acceptance/features/coreApiSharees/sharees.feature index dd5176c9c2..c2ae7ba280 100644 --- a/tests/acceptance/features/coreApiSharees/sharees.feature +++ b/tests/acceptance/features/coreApiSharees/sharees.feature @@ -22,11 +22,11 @@ Feature: search sharees And the HTTP status code should be "200" And the "exact users" sharees returned should be empty And the "users" sharees returned should be - | Sharee One | 0 | sharee1 | + | Sharee One | 0 | sharee1 | sharee1 | And the "exact groups" sharees returned should be empty And the "groups" sharees returned should be - | ShareeGroup | 1 | ShareeGroup | - | ShareeGroup2 | 1 | ShareeGroup2 | + | ShareeGroup | 1 | ShareeGroup | ShareeGroup | + | ShareeGroup2 | 1 | ShareeGroup2 | ShareeGroup2 | And the "exact remotes" sharees returned should be empty And the "remotes" sharees returned should be empty Examples: @@ -44,11 +44,11 @@ Feature: search sharees And the HTTP status code should be "200" And the "exact users" sharees returned should be empty And the "users" sharees returned should be - | Sharee One | 0 | sharee1 | + | Sharee One | 0 | sharee1 | sharee1 | And the "exact groups" sharees returned should be empty And the "groups" sharees returned should be - | ShareeGroup | 1 | ShareeGroup | - | ShareeGroup2 | 1 | ShareeGroup2 | + | ShareeGroup | 1 | ShareeGroup | ShareeGroup | + | ShareeGroup2 | 1 | ShareeGroup2 | ShareeGroup2 | And the "exact remotes" sharees returned should be empty And the "remotes" sharees returned should be empty Examples: @@ -67,11 +67,11 @@ Feature: search sharees And the HTTP status code should be "200" And the "exact users" sharees returned should be empty And the "users" sharees returned should be - | Sharee One | 0 | sharee1 | + | Sharee One | 0 | sharee1 | sharee1 | And the "exact groups" sharees returned should be empty And the "groups" sharees returned should be - | ShareeGroup | 1 | ShareeGroup | - | ShareeGroup2 | 1 | ShareeGroup2 | + | ShareeGroup | 1 | ShareeGroup | ShareeGroup | + | ShareeGroup2 | 1 | ShareeGroup2 | ShareeGroup2 | And the "exact remotes" sharees returned should be empty And the "remotes" sharees returned should be empty Examples: @@ -88,7 +88,7 @@ Feature: search sharees Then the OCS status code should be "" And the HTTP status code should be "200" And the "exact users" sharees returned should be - | Sharee One | 0 | sharee1 | + | Sharee One | 0 | sharee1 | sharee1 | And the "users" sharees returned should be empty And the "exact groups" sharees returned should be empty And the "groups" sharees returned should be empty @@ -108,7 +108,7 @@ Feature: search sharees Then the OCS status code should be "" And the HTTP status code should be "200" And the "exact users" sharees returned should be - | Sharee One | 0 | sharee1 | + | Sharee One | 0 | sharee1 | sharee1 | And the "users" sharees returned should be empty And the "exact groups" sharees returned should be empty And the "groups" sharees returned should be empty @@ -130,7 +130,7 @@ Feature: search sharees And the "exact users" sharees returned should be empty And the "users" sharees returned should be empty And the "exact groups" sharees returned should be - | ShareeGroup2 | 1 | ShareeGroup2 | + | ShareeGroup2 | 1 | ShareeGroup2 | ShareeGroup2 | And the "groups" sharees returned should be empty And the "exact remotes" sharees returned should be empty And the "remotes" sharees returned should be empty @@ -148,7 +148,7 @@ Feature: search sharees Then the OCS status code should be "" And the HTTP status code should be "200" And the "exact users" sharees returned should be - | Sharee One | 0 | sharee1 | + | Sharee One | 0 | sharee1 | sharee1 | And the "users" sharees returned should be empty And the "exact groups" sharees returned should be empty And the "groups" sharees returned should be empty @@ -173,7 +173,7 @@ Feature: search sharees And the HTTP status code should be "200" And the "exact users" sharees returned should be empty And the "users" sharees returned should be - | Another | 0 | another | + | Another | 0 | another | another | And the "exact groups" sharees returned should be empty And the "groups" sharees returned should be empty And the "exact remotes" sharees returned should be empty @@ -194,15 +194,49 @@ Feature: search sharees And the HTTP status code should be "200" And the "exact users" sharees returned should be empty And the "users" sharees returned should be - | Sharee One | 0 | sharee1 | - | Sharee Two | 0 | sharee2 | + | Sharee One | 0 | sharee1 | sharee1 | + | Sharee Two | 0 | sharee2 | sharee2 | And the "exact groups" sharees returned should be empty And the "groups" sharees returned should be - | ShareeGroup | 1 | ShareeGroup | - | ShareeGroup2 | 1 | ShareeGroup2 | + | ShareeGroup | 1 | ShareeGroup | ShareeGroup | + | ShareeGroup2 | 1 | ShareeGroup2 | ShareeGroup2 | And the "exact remotes" sharees returned should be empty And the "remotes" sharees returned should be empty Examples: | ocs-api-version | ocs-status-code | | 1 | 100 | | 2 | 200 | + + @env-config + Scenario Outline: search other users when OCIS_SHOW_USER_EMAIL_IN_RESULTS config is enabled + Given user "Brian" has been created with default attributes and without skeleton files + And the config "OCIS_SHOW_USER_EMAIL_IN_RESULTS" has been set to "true" + And using OCS API version "" + When user "Alice" gets the sharees using the sharing API with parameters + | search | Brian | + | itemType | file | + Then the OCS status code should be "" + And the HTTP status code should be "200" + And the "exact users" sharees returned should be + | Brian Murphy | 0 | Brian | brian@example.org | + Examples: + | ocs-api-version | ocs-status-code | + | 1 | 100 | + | 2 | 200 | + + @env-config + Scenario Outline: search other users when OCIS_SHOW_USER_EMAIL_IN_RESULTS config is disabled + Given user "Brian" has been created with default attributes and without skeleton files + And the config "OCIS_SHOW_USER_EMAIL_IN_RESULTS" has been set to "false" + And using OCS API version "" + When user "Alice" gets the sharees using the sharing API with parameters + | search | Brian | + | itemType | file | + Then the OCS status code should be "" + And the HTTP status code should be "200" + And the "exact users" sharees returned should be + | Brian Murphy | 0 | Brian | Brian | + Examples: + | ocs-api-version | ocs-status-code | + | 1 | 100 | + | 2 | 200 |