treenode | UlohaVzorakNode se v treenodeeditoru zobrazuje jen orgům

This commit is contained in:
Aneta Pokorná 2020-12-02 00:39:19 +01:00
parent 0ebc9b5f32
commit 71a2e98dda

View file

@ -90,4 +90,7 @@ class UlohaVzorakNodeViewSet(PermissionMixin, viewsets.ModelViewSet):
nazev = self.request.query_params.get('nazev',None)
if nazev is not None:
queryset = queryset.filter(nazev__contains=nazev)
return queryset
if self.request.user.has_perm('auth.org'):
return queryset
else: # pro neorgy jen zveřejněné vzoráky
return queryset.filter(uloha__cislo_reseni__verejne_db=True)