-
Notifications
You must be signed in to change notification settings - Fork 62
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
Permissions: has_permission() takes 3 positional arguments but 4 were given #19
Comments
Hi there, what version of channels are you using? Can you share a form of your binding class? Thanks |
@linuxlewis First off thank you so much for this package! Second Thanks for the quick reply. Channels version
Binding ClassHere is my bindings for my "Friendship" models
Routing.py
|
@linuxlewis I think I found the problem. I didn't have the channels_api default settings in my projects settings file. |
I would like to get your thoughts on how I could limit the responses based on the authed user. When I am sub'ed to friendship requests I get all created requests not just the ones pertaining to the authed user. |
Can you post your settings or better yet can you reproduce in a test case? |
To filter the create messages you will need to put the users in a group that is scoped to their user instead of the resource. This can be accomplished by implementing the method from channels_api.bindings import ResourceBinding
class MyBinding(ResourceBinding):
def _group_name(self, action, id=None):
if action == "create":
return "{}-{}-{}".format(self.model_label, action, user_id) |
Hi, I am getting the same error: I think I have configured everything properly and I am unsure how to fix this error |
I am getting this error after I updated the package
The text was updated successfully, but these errors were encountered: