Giter Club home page Giter Club logo

Comments (7)

fairview avatar fairview commented on June 7, 2024

Permission has content_type, but no instance ID. I should perhaps have coffee before asking this, but how would you connect them to model instances?

from django-guardian.

lukaszb avatar lukaszb commented on June 7, 2024

Maybe I haven't stated this clearly enough.

We remove content_type. We do NOT remove object_pk.

We fix content_object so we remain backward compatibility. But we do NOT use generic foreign key as it is used right now.

from django-guardian.

lukaszb avatar lukaszb commented on June 7, 2024

Postponed till v1.1

from django-guardian.

bltravis avatar bltravis commented on June 7, 2024

Are there any performance gains to be had by implementing this change? Or, are we just trading DRYness for simplicity?

from django-guardian.

filipefigcorreia avatar filipefigcorreia commented on June 7, 2024

@bltravis I think it would be simpler the @lukaszb is suggesting. I found the duplication really confusing when I've looked at the models for the first time.

from django-guardian.

filipefigcorreia avatar filipefigcorreia commented on June 7, 2024

In fact, I have another suggestion. Any objections on removing the dependency from auth.Permission, and maintaining only the relation between BaseObjectPermission and ContentType?

I'm not sure of the implications but it seams a cleaner solution. The auth.Permission model was meant only for model-level permissions, and that is the meaning underlying its foreign key to ContentType. Overloading its meaning for object-level permissions can probably break other django features, no?

from django-guardian.

lukaszb avatar lukaszb commented on June 7, 2024

Closing, as it was already implemented. As for the last suggestion - it's not bad idea, however build-in Permission model has this automatic creation base on Meta.permissions which is pretty nice and we would need to re-implement this feature in guardian. Something we can think of for v2...

from django-guardian.

Related Issues (20)

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.