Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How about supporting Views that don't use models? #44

Open
dedsm opened this issue Sep 26, 2017 · 2 comments
Open

How about supporting Views that don't use models? #44

dedsm opened this issue Sep 26, 2017 · 2 comments

Comments

@dedsm
Copy link

dedsm commented Sep 26, 2017

I have some use cases where my views don't use models, I think it would be nice if dry-rest-permissions supports it, right now I could override my serializer so the meta.Model is a custom class with the has_* functions but I think having a get_permissions_class or a similar named function in the view to return it would be better, maybe that could be in a Mixin and the default would be the behavior we have now?

@mesin
Copy link

mesin commented Jan 17, 2018

@dedsm how did you solve the issue?

@dedsm
Copy link
Author

dedsm commented Jan 18, 2018

@mesin at the end I think I went another way, but what I said should work, dry-rest-permissions checks for the model in the serializer IIRC so modifying the serializer to have a non-django "model" with the permission functions should work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants