owncloud / owncloud/ocis

Edit space member with no permissions returns 500

Open
#12,034 9 comments 0 reactions 0 assignees View on GitHub
Type:Bug
Dominant language
Go
Stars
2.1k
Forks
274
Avg merge
2d 2h
Merged PRs (30d)
106

Description

## 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//u:' -d '{"expirationDateTime":"2026-02-28T22:59:59.999Z","roles":[""]}'
```

Image

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.