def get(self, request, aquifer_id): client = MinioClient(request=request, disable_private=True) documents = client.get_documents(int(aquifer_id), resource="aquifer", include_private=False) return Response(documents)
def get(self, request, person_guid): user_is_staff = self.request.user.groups.filter( Q(name=REGISTRIES_EDIT_ROLE) | Q(name=REGISTRIES_VIEWER_ROLE)).exists() client = MinioClient( request=request, disable_private=(not user_is_staff)) documents = client.get_documents( person_guid, resource="driller", include_private=user_is_staff) return Response(documents)
def get(self, request, tag): user_is_staff = self.request.user.groups.filter( name=WELLS_VIEWER_ROLE).exists() client = MinioClient(request=request, disable_private=(not user_is_staff)) documents = client.get_documents(int(tag), include_private=user_is_staff) return Response(documents)
def get(self, request, aquifer_id, **kwargs): user_is_staff = self.request.user.groups.filter( name=AQUIFERS_EDIT_ROLE).exists() client = MinioClient(request=request, disable_private=(not user_is_staff)) documents = client.get_documents(int(aquifer_id), resource="aquifer", include_private=user_is_staff) return Response(documents)
def get(self, request, tag, **kwargs): well = get_object_or_404(Well, pk=tag) if well.well_publication_status\ .well_publication_status_code == 'Unpublished': if not self.request.user.groups.filter(name=WELLS_EDIT_ROLE).exists(): return HttpResponseNotFound() user_is_staff = self.request.user.groups.filter( name=WELLS_VIEWER_ROLE).exists() client = MinioClient( request=request, disable_private=(not user_is_staff)) documents = client.get_documents( int(tag), resource="well", include_private=user_is_staff) return Response(documents)