Skip to content

Commit

Permalink
refactor test to add federated user to a project space
Browse files Browse the repository at this point in the history
Signed-off-by: prashant-gurung899 <[email protected]>
  • Loading branch information
prashant-gurung899 committed Oct 22, 2024
1 parent 10bf7f1 commit fd89535
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,6 @@ The expected failures in this file are from features in the owncloud/ocis repo.

- [apiOcm/deleteFederatedConnections.feature:103](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiOcm/deleteFederatedConnections.feature#L103)

#### [OCM. Prevent federated users from being added as members of the space](https://github.com/owncloud/ocis/issues/10051)

- [apiOcm/share.feature:307](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiOcm/share.feature#L307)
- [apiOcm/share.feature:308](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiOcm/share.feature#L308)
- [apiOcm/share.feature:309](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiOcm/share.feature#L309)

#### [same href in REPORT request for all dav-path-version](https://github.com/owncloud/ocis/issues/7060)

- [apiSearch1/dateSearch.feature:17](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSearch1/dateSearch.feature#L17)
Expand Down
57 changes: 36 additions & 21 deletions tests/acceptance/features/apiOcm/share.feature
Original file line number Diff line number Diff line change
Expand Up @@ -272,43 +272,58 @@ Feature: an user shares resources using ScienceMesh application
And "Alice" has created the federation share invitation
And using server "REMOTE"
And "Brian" has accepted invitation
And using server "LOCAL"
And using spaces DAV path
And the administrator has assigned the role "Space Admin" to user "Brian" using the Graph API
And user "Brian" has created a space "brian's space" with the default quota using the Graph API
When user "Brian" tries to send the following space share invitation to federated user using permissions endpoint of the Graph API:
| space | brian's space |
| sharee | Alice |
| shareType | user |
| permissionsRole | <permissions-role> |
| federatedServer | @ocis-server:9200 |
Then the HTTP status code should be "403"
And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
And user "Alice" has created a space "alice's space" with the default quota using the Graph API
When user "Alice" tries to send the following space share invitation to federated user using permissions endpoint of the Graph API:
| space | alice's space |
| sharee | Brian |
| shareType | user |
| permissionsRole | <permissions-role> |
| federatedServer | @federation-ocis-server:10200 |
Then the HTTP status code should be "400"
And the JSON data of the response should match
"""
{
"type": "object",
"required": [
"code",
"message"
],
"required": ["error"],
"properties": {
"code": {
"const": "PERMISSION_DENIED"
},
"message": {
"const": "permission denied to create the file"
"error": {
"type": "object",
"required": [
"code",
"innererror",
"message"
],
"properties": {
"code": {
"const": "invalidRequest"
},
"innererror": {
"type": "object",
"required": [
"date",
"request-id"
]
},
"message": {
"const": "federated user can not become a space member"
}
}
}
}
}
"""
And using server "LOCAL"
And the user "Alice" should not have a space called "brian's space"
And using server "REMOTE"
And the user "Brian" should not have a space called "alice's space"
Examples:
| permissions-role |
| Space Viewer |
| Space Editor |
| Manager |


@issue-10051
Scenario Outline: try to add federated user as a member of a project space (root endpoint)
Given using server "LOCAL"
And using spaces DAV path
Expand Down

0 comments on commit fd89535

Please sign in to comment.