Skip to content

api-test: deleting space#2970

Open
ScharfViktor wants to merge 3 commits into
mainfrom
api-test-delete-space
Open

api-test: deleting space#2970
ScharfViktor wants to merge 3 commits into
mainfrom
api-test-delete-space

Conversation

@ScharfViktor

@ScharfViktor ScharfViktor commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

  | action                           | space admin (system role) | space manager (space role) | space viewer/editor (space role) |
  | disable space                    | allowed (204)             | allowed (204)              | denied (403)                     |
  | list disabled space (/me/drives) | yes                       | yes                        | no                               |
  | enable space                     | allowed (200)             | allowed (200)              | denied (404)  should be 403?     |
  | delete space                     | allowed (204)             | denied (403)               | denied (404)  should be 403?     |

@rhafer what we expect here?

  • user member (viewer/editor (space role) user(system role)) tries to enable/delete space -> 403 I think, or 404 because user cannot read disabled space

  • user not member (user(system role)) tries to enable/delete space -> 404 because no access to space

  • Space manager(space member role) without space admin(user role) cannot delete space test

  • Refactor tests

related #1799

@codacy-production

codacy-production Bot commented Jun 17, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Coverage ∅ diff coverage · +0.01% coverage variation

Metric Results
Coverage variation +0.01% coverage variation (-1.00%)
Diff coverage diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (346cfab) 82262 18943 23.03%
Head commit (f0b793d) 82262 (+0) 18955 (+12) 23.04% (+0.01%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#2970) 0 0 ∅ (not applicable)

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@ScharfViktor ScharfViktor force-pushed the api-test-delete-space branch from 177ddd4 to 9bc3f03 Compare June 18, 2026 07:14
@ScharfViktor

Copy link
Copy Markdown
Contributor Author
Scenario Outline: delete space via the Graph API                                                  # /woodpecker/src/github.com/opencloud-eu/opencloud/tests/acceptance/features/apiSpaces/disableEnableDeleteSpaces.feature:191
    Given the administrator has assigned the role "<user-role>" to user "Brian" using the Graph API # GraphContext::theAdministratorHasGivenTheRoleUsingTheGraphApi()
    And user "Alice" has sent the following space share invitation:                                 # SharingNgContext::userHasSentTheFollowingShareShareInvitation()
      | space           | Project Moon |
      | sharee          | Brian        |
      | shareType       | user         |
      | permissionsRole | <space-role> |
    And user "Alice" has disabled a space "Project Moon"                                            # SpacesContext::sendUserHasDisabledSpaceRequest()
    When user "Brian" deletes a space "Project Moon"                                                # SpacesContext::userDeletesSpace()
    Then the HTTP status code should be "<code>"                                                    # FeatureContext::thenTheHTTPStatusCodeShouldBe()

    Examples:
      | user-role   | space-role   | code |
      | Space Admin | Space Viewer | 204  |
      | User        | Manager      | 404  |
        Failed step: Then the HTTP status code should be "404"

is failed. needs reva bump opencloud-eu/reva#672

@ScharfViktor

Copy link
Copy Markdown
Contributor Author

need rebase after #2975

@rhafer

rhafer commented Jun 18, 2026

Copy link
Copy Markdown
Member
  • user member (viewer/editor (space role) user(system role)) tries to enable/delete space -> 403 I think, or 404 because user cannot read disabled space

If the space is already disabled they should get a 404. Because they cannot read the space.

  • user not member (user(system role)) tries to enable/delete space -> 404 because no access to space

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants