owncloud / owncloud/ocis

Same users can be added in a group multiple time

Open
#5,702 4 comments 0 reactions 0 assignees View on GitHub
Type:Bug
Dominant language
Go
Stars
2.1k
Forks
274
Avg merge
2d 1h
Merged PRs (30d)
103

Description

## Describe the bug

Add users to a group at once. Again try to add the same users in the same group then we have a 204 status code.
Both endpoints to add members to the group behave in the same way
- Adding a single member to a group
- Adding multiple members in a single request

## Steps to reproduce

Steps to reproduce the behavior:

1. add users to a group at once
```
curl --location --request PATCH 'https://localhost:9200/graph/v1.0/groups/bdac72d5-1bfe-42ea-849d-72c52f885980/' \
--header 'Authorization: Basic YWRtaW46YWRtaW4=' \
--header 'Content-Type: application/json' \
--data-raw '{
"members@odata.bind": [
"https://localhost:9200/graph/v1.0/users/4c510ada-c86b-4815-8820-42cdf82c3d51",
"https://localhost:9200/graph/v1.0/users/058bff95-6708-4fe5-91e4-9ea3d377588b"
]
}'
```
2. Again add same user to same group
```
curl --location --request PATCH 'https://localhost:9200/graph/v1.0/groups/bdac72d5-1bfe-42ea-849d-72c52f885980/' \
--header 'Authorization: Basic YWRtaW46YWRtaW4=' \
--header 'Content-Type: application/json' \
--data-raw '{
"members@odata.bind": [
"https://localhost:9200/graph/v1.0/users/4c510ada-c86b-4815-8820-42cdf82c3d51",
"https://localhost:9200/graph/v1.0/users/058bff95-6708-4fe5-91e4-9ea3d377588b"
]
}'
```

## Expected behavior
Some error message should be thrown/

## Actual behavior
Gives Http status code `204`

## Setup

Please describe how you started the server and provide a list of relevant environment variables or configuration files.

```console
OCIS_XXX=somevalue
OCIS_YYY=somevalue
PROXY_XXX=somevalue
```

## Additional context
Add any other context about the problem here.

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.