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
- In a mobile client, Alice, who is a
manager clicks on Bob who is also a manager to edit his permissions and expiration date
- Alice clicks Bob's permission to turn him into
editor and add an expiration date without submitting
- Charles, who is also a
manager, changes Alice's permission from manager to editor
- 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>"]}'

Describe the bug
The bug was discovered during Android client testing. Space
manageris downgraded toeditorjust 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 is403 Forbidden. But the server returns a500Steps to reproduce
managerclicks on Bob who is also amanagerto edit his permissions and expiration dateeditorand add an expiration date without submittingmanager, changes Alice's permission frommanagertoeditorExpected behavior
Alice is no longer manager, so, she is not allowed to edit Bob. Therefore, backend should return a
403 ForbiddenActual behavior
Backend returns
500Try the following curl where the user who triggers should not be a
manager.