Skip to content

Commit

Permalink
user perm
Browse files Browse the repository at this point in the history
  • Loading branch information
Raruto committed Jan 9, 2024
1 parent c79dfee commit 7e5be19
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions g3w-admin/qdjango/api/projects/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,10 +599,12 @@ def readLeaf(layer, container):
# reset tokenfilter by session
self.reset_filtertoken()

ret['edit_url'] = reverse('qdjango-project-update', kwargs={
'group_slug': instance.group.slug,
'slug': instance.slug
})
# add edit url if user has grant
if self.request.user.has_perm('qdjango.change_project', instance):
ret['edit_url'] = reverse('qdjango-project-update', kwargs={
'group_slug': instance.group.slug,
'slug': instance.slug
})

return ret

Expand Down

0 comments on commit 7e5be19

Please sign in to comment.