Giter Site home page Giter Site logo

Comments (2)

bellini666 avatar bellini666 commented on May 29, 2024 1

Hi @justinask7 , I just released a new version with the change and it should be hitting pypi's repository in the next minutes.

Feel free to open any other issues regarding problems you find or even suggestions for the lib!

from graphene-django-plus.

bellini666 avatar bellini666 commented on May 29, 2024

Hi @justinask7 ,

The change was made because, actually, it would never return False (at least not after v1.4). The problem is, based on the fact that GuardedModelManager.for_user should return a queryset that can only contain models that the user can see, the get_node function would already filter any object that doesn't have permissions out, so the object there will be None (as you can see in this NOTE: https://github.com/0soft/graphene-django-plus/blob/master/graphene_django_plus/types.py#L148).

You are saying in point number 2 that it was useful for some extra business logic. What version were you using before upgrading to this one? There was an issue before v1.4 that was making optimized models not use the type's queryset but the base queryset instead (optimizer passes cls._meta.model.objects instead of c.get_queryset, which is oposed to what the default get_node does), which I fixed in this commit.

But having said all that, I can add a call to it back so that one can do some extra checking in it. It will not affect the default implementation because of the reasons I explained in the first paragraph.

Thanks for pointing that out and glad to see other people using this library :)

from graphene-django-plus.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.