dfunckt / django-rules

Awesome Django authorization, without the database

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not possible to pass a GET/POST request parameter to objectgetter()

chinniehendrix opened this issue · comments

It seems like there is no way to pass a request parameter to the rules.contrib.views.objectgetter() function in order to retrieve the object to perform the permission check on.

Indeed you can't. But why you need that? objectgetter serves for the most common use-case and does one thing only. You should consider using permission_required with a custom function (instead of objectgetter) for other use-cases.

Yes, indeed. Sorry, I had not understood the other example provided in the docs correctly. Thanks for your help on this!