1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-08-09 15:35:24 +02:00

fix: prevent recipe sharing from different group (#4929)

This commit is contained in:
Kuchenpirat 2025-01-22 16:51:29 +01:00 committed by Ian Pösse-Koch
parent eda2b2d88c
commit 3e95b4e955
2 changed files with 15 additions and 0 deletions

View file

@ -110,3 +110,12 @@ def test_recipe_share_tokens_delete_one(api_client: TestClient, unique_user: Tes
token = database.recipe_share_tokens.get_one(token.id)
assert token is None
def test_share_recipe_from_different_group(api_client: TestClient, unique_user: TestUser, g2_user: TestUser, slug: str):
database = unique_user.repos
recipe = database.recipes.get_one(slug)
assert recipe
response = api_client.post(api_routes.shared_recipes, json={"recipeId": str(recipe.id)}, headers=g2_user.token)
assert response.status_code == 404