Skip to content

api-test: deleting space - #2970

Merged
v-scharf merged 3 commits into
mainfrom
api-test-delete-space
Jun 24, 2026
Merged

v-scharf merged 3 commits into
mainfrom
api-test-delete-space

Conversation

@v-scharf

@v-scharf v-scharf 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.02% coverage variation

Metric Results
Coverage variation ✅ -0.02% coverage variation (-1.00%)
Diff coverage ✅ ∅ diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (8cd0859) 82282 18957 23.04%
Head commit (b323264) 82282 (+0) 18943 (-14) 23.02% (-0.02%)

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.

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

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

@v-scharf

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

👍

@v-scharf
v-scharf force-pushed the api-test-delete-space branch from f0b793d to 464219f Compare June 23, 2026 13:51
@v-scharf
v-scharf requested a review from rhafer June 23, 2026 13:51
@v-scharf

Copy link
Copy Markdown
Contributor Author

@rhafer I rebased after merging #2975
now tests should be green

@v-scharf
v-scharf force-pushed the api-test-delete-space branch from 464219f to a231652 Compare June 23, 2026 14:45

@rhafer rhafer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just to minor nit-picks. Tests look fine.

@v-scharf
v-scharf requested a review from rhafer June 24, 2026 09:07
@v-scharf
v-scharf requested a review from rhafer June 24, 2026 09:15
@v-scharf
v-scharf enabled auto-merge (squash) June 24, 2026 09:15
@v-scharf
v-scharf merged commit 5c4a660 into main Jun 24, 2026
60 checks passed
@v-scharf
v-scharf deleted the api-test-delete-space branch June 24, 2026 10:05
@openclouders openclouders mentioned this pull request Jun 24, 2026
1 task
sdwilsh pushed a commit to sdwilsh/ansible-playbooks that referenced this pull request Jul 15, 2026
##### [\`7.3.0\`](https://github.com/opencloud-eu/opencloud/blob/HEAD/CHANGELOG.md#730---2026-07-14)

##### 🐛 Bug Fixes

- fix(proxy): honor access token cache ttl \[[#3056](opencloud-eu/opencloud#3056)]
- chore(idp): update axios \[[#3094](opencloud-eu/opencloud#3094)]
- fix: make the collaboration service events optional \[[#3001](opencloud-eu/opencloud#3001)]
- Revert "fix: disallow thumbnails for tiff and jpeg2000 images" \[[#2973](opencloud-eu/opencloud#2973)]
- bump reva \[[#2950](opencloud-eu/opencloud#2950)]
- change error level for trashing items interaction with search \[[#2951](opencloud-eu/opencloud#2951)]
- fix: Send SSE events for SpaceEnabled/Disabled to affected users \[[#2871](opencloud-eu/opencloud#2871)]

##### 📚 Documentation

- update collaboration readme \[[#3076](opencloud-eu/opencloud#3076)]
- fix: fix typo in proxy service documentation \[[#3089](opencloud-eu/opencloud#3089)]
- roling release template \[[#2972](opencloud-eu/opencloud#2972)]
- enhance: fix typos in webfinger service description \[[#2958](opencloud-eu/opencloud#2958)]

##### ✅ Tests

- \[full-ci] gherkin steps refactoring. cleaning code \[[#3100](opencloud-eu/opencloud#3100)]
- \[decomposed] more cli command tests \[[#3087](opencloud-eu/opencloud#3087)]
- test(apiSpaces): a space admin can delete a space with no manager \[[#3040](opencloud-eu/opencloud#3040)]
- Update tests for [opencloud-eu/reva#655](opencloud-eu/reva#655) \[[#2889](opencloud-eu/opencloud#2889)]
- api-test: deleting space \[[#2970](opencloud-eu/opencloud#2970)]

##### 📈 Enhancement

- feat: add disableSponsorLink web config option \[[#3093](opencloud-eu/opencloud#3093)]
- feat(graph): add MS Graph colon-syntax path lookup middleware \[[#2688](opencloud-eu/opencloud#2688)]
- feat: adjust theme chrome colors and logos \[[#2599](opencloud-eu/opencloud#2599)]
- add tls support for all nats connections \[[#2063](opencloud-eu/opencloud#2063)]
- feat: add more roles \[[#2928](opencloud-eu/opencloud#2928)]
- next to main \[[#2924](opencloud-eu/opencloud#2924)]
- feat: add core apps env variable to override the default core apps \[[#2930](opencloud-eu/opencloud#2930)]

##### 📦️ Dependencies

- build(deps): bump golang.org/x/image from 0.43.0 to 0.44.0 \[[#3112](opencloud-eu/opencloud#3112)]
- build(deps): bump golang.org/x/text from 0.39.0 to 0.40.0 \[[#3101](opencloud-eu/opencloud#3101)]
- \[full-ci] chore: bump web to v7.2.0 \[[#3121](opencloud-eu/opencloud#3121)]
- build(deps): bump golang.org/x/term from 0.44.0 to 0.45.0 \[[#3103](opencloud-eu/opencloud#3103)]
- build(deps): bump github.com/coreos/go-oidc/v3 from 3.19.0 to 3.20.0 \[[#3102](opencloud-eu/opencloud#3102)]
- build(deps): bump golang.org/x/text from 0.38.0 to 0.39.0 \[[#3085](opencloud-eu/opencloud#3085)]
- build(deps): bump github.com/go-chi/chi/v5 from 5.3.0 to 5.3.1 \[[#3073](opencloud-eu/opencloud#3073)]
- build(deps): bump github.com/nats-io/nats-server/v2 from 2.14.2 to 2.14.3 \[[#3063](opencloud-eu/opencloud#3063)]
- build(deps): bump github.com/gookit/config/v2 from 2.2.8 to 2.2.9 \[[#3075](opencloud-eu/opencloud#3075)]
- build(deps): bump github.com/open-policy-agent/opa from 1.18.1 to 1.18.2 \[[#3061](opencloud-eu/opencloud#3061)]
- build(deps): bump github.com/kovidgoyal/imaging from 1.8.21 to 1.8.22 \[[#3060](opencloud-eu/opencloud#3060)]
- build(deps): bump github.com/libregraph/lico from 0.66.0 to 0.67.0 \[[#3028](opencloud-eu/opencloud#3028)]
- chore: bump web to v7.2.0-beta.3 \[[#2953](opencloud-eu/opencloud#2953)]
- chore: bump reva to latest main \[[#2943](opencloud-eu/opencloud#2943)]
flash7777 pushed a commit to flash7777/opencloud that referenced this pull request Oct 13, 2026
* api-test: deleting space

* Update feature file for space management actions

* Update disableEnableDeleteSpaces.feature
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