treenode | UlohaVzorakNode se v treenodeeditoru zobrazuje jen orgům
This commit is contained in:
parent
0ebc9b5f32
commit
71a2e98dda
1 changed files with 4 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue