forked from sr2/cloud-api
feat: add group user by id restriction
Adding by ID can only be done for existing org members
This commit is contained in:
parent
3dbd72a109
commit
0b521414b3
2 changed files with 9 additions and 2 deletions
|
|
@ -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}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue