Alternative to `RulesModelBase` in DRF to manage dependency on this library.
See original GitHub issueI’m working on a Django DRF project, and while implementing the rules, I feel like inheriting from RulesModelBase
creates a really heavy dependency on this library.
I’m trying to make it so that the rules
dependency only affects the views, and not go all the way to the models.
From what I can gather, the views have access to the current user, and the objects. The predicates get both the user and the permission object as parameters, so it feels like it would be possible.
Has anyone dealt with similar issues than this?
https://github.com/dfunckt/django-rules#permissions-in-django-rest-framework
Of course, it also requires you to declare your models as described in Permissions in models.
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Learning the Basics - Gradle User Manual
Dependency management in Gradle; Declaring repositories; Declaring dependencies; Understanding the difference between libraries and applications ...
Read more >Strategies for managing Gradle dependencies - ProAndroidDev
In the life of an Android Developer, library dependencies are like heart of the project. ... Strategy 1: So let's start with the...
Read more >Managing dependencies in Visual Studio C++ projects with ...
There are different alternatives, the first one would be using different names for the library, for example zlibd.lib for the debug one, zlib....
Read more >sbt Reference Manual — Library Management
They are intended as a lightweight alternative to a full configuration using Ivy. Dependencies. Declaring a dependency looks like: libraryDependencies += ...
Read more >django-rules issues and how to fix | GitAnswer
List of issues in dfunckt/django-rules projects. django-rules alternative to `RulesModelBase` in DRF to manage dependency on this library.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Sure, I’ll post a PR for this. Actually maybe I can make 2:
get_permission_form_model
making it overridable in the mixinWe can move the discussion there as well, since it’s easier to discuss things with concrete code 😃
Thanks for taking the time and attention on this! Really appreciate it!
Okay, I totally see the use-case and agree in principle that this would be great to have but I need to spend some time to check the existing code and your proposal in more depth. If you’re keen to PR stuff in the meantime, feel free and we’ll take it from there.