feat: add group user by id restriction
All checks were successful
ci / lint_and_test (push) Successful in 14s

Adding by ID can only be done for existing org members
This commit is contained in:
Chris Milne 2026-06-10 14:48:22 +01:00
parent 3dbd72a109
commit 0b521414b3
2 changed files with 9 additions and 2 deletions

View file

@ -4,7 +4,7 @@ import pytest
from httpx import AsyncClient
from src.user.models import User
from src.organisation.models import Organisation as Org
from src.organisation.models import Organisation as Org, OrgUsers
from src.iam.models import Group
from .conftest import generate_query_and_status
@ -468,6 +468,8 @@ async def test_put_group_user_success(default_client: AsyncClient, db_session):
)
)
db_session.flush()
db_session.add(OrgUsers(user_id=2, org_id=1))
db_session.flush()
resp = await default_client.put(
"/iam/group/user", json={"user_id": 2, "group_id": 1, "organisation_id": 1}