Skip to content

Edit space member with no permissions returns 500 #12034

@jesmrec

Description

@jesmrec

Describe the bug

The bug was discovered during Android client testing. Space manager is downgraded to editor just before submitting a permission and expiration date change on other member. Request is sent to the server but the user is not manager, so the expected result is 403 Forbidden. But the server returns a 500

Steps to reproduce

  1. In a mobile client, Alice, who is a manager clicks on Bob who is also a manager to edit his permissions and expiration date
  2. Alice clicks Bob's permission to turn him into editor and add an expiration date without submitting
  3. Charles, who is also a manager, changes Alice's permission from manager to editor
  4. Alice submits changes in 2.

Expected behavior

Alice is no longer manager, so, she is not allowed to edit Bob. Therefore, backend should return a 403 Forbidden

Actual behavior

Backend returns 500

Try the following curl where the user who triggers should not be a manager.

curl -H 'X-Request-ID: 85294fbf-3fa9-4457-80a8-84e20854103c' -H 'User-Agent: Mozilla/5.0 (Android) ownCloud-android/4.7.0' -H 'Accept-Language: en' --compressed -H 'Authorization: Bearer xxx' -H 'Content-Type: application/json; charset=utf-8' -H 'Connection: Keep-Alive' -X PATCH 'https://xx.xx.xx.xx:9200/graph/v1beta1/drives/<drive-id>/u:<Bob-id>' -d '{"expirationDateTime":"2026-02-28T22:59:59.999Z","roles":["<editor-role-id>"]}'
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions