mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-07 15:18:20 -05:00
Merge pull request #2106 from swnf/fix-share-permissions
Fix share permission check
This commit is contained in:
@@ -1382,7 +1382,7 @@ def sync_all(request):
|
|||||||
|
|
||||||
|
|
||||||
def share_link(request, pk):
|
def share_link(request, pk):
|
||||||
if request.space.allow_sharing and has_group_permission(request.user, 'user'):
|
if request.space.allow_sharing and has_group_permission(request.user, ('user',)):
|
||||||
recipe = get_object_or_404(Recipe, pk=pk, space=request.space)
|
recipe = get_object_or_404(Recipe, pk=pk, space=request.space)
|
||||||
link = ShareLink.objects.create(recipe=recipe, created_by=request.user, space=request.space)
|
link = ShareLink.objects.create(recipe=recipe, created_by=request.user, space=request.space)
|
||||||
return JsonResponse({'pk': pk, 'share': link.uuid,
|
return JsonResponse({'pk': pk, 'share': link.uuid,
|
||||||
|
|||||||
Reference in New Issue
Block a user