-
Notifications
You must be signed in to change notification settings - Fork 97
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
Update access-control.rst #69
base: master
Are you sure you want to change the base?
Conversation
Fixed minor spelling typos and added phrases for clarity.
- Only an authenticated user can create a choice. | ||
- Authenticated users can create choices only for polls they have created. | ||
- Authenticated users can delete only polls they have created. | ||
- Only an authenticated user can vote. Users can vote for other people's polls. | ||
- Only an authenticated user can vote. Authenticated users can vote on other people's polls. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only an authenticated user can vote. They can also vote on other people's polls
Which give back this response. | ||
Doing so gives back this response. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which gives back this response:
or
Which returns the response below
Note the :code:`authentication_classes = ()` and :code:`permission_classes = ()` to exempt :code:`UserCreate` from global authentication scheme. | ||
Note the :code:`authentication_classes = ()` and :code:`permission_classes = ()` statements which exempt :code:`UserCreate` from the global authentication scheme. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert
|
||
We want to ensure that tokens are created when user is created in :code:`UserCreate` view, so we update the :code:`UserSerializer`. Change your :code:`serializers.py` like this | ||
To ensure that tokens are created when a user is created in the :code:`UserCreate` view, we need to update the :code:`UserSerializer`. Edit your :code:`serializers.py` to accomodate this change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Edit your serializers.py
as explained below:
POST with a incorrect username and password, and you will get a response like this, with a HTTP status of 400. | ||
Do a POST with a incorrect username and password, and you will get a response like this, with a HTTP status of 400. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert and update:
POST with an incorrect username and password, and you will get a response like this, with a HTTP status of 400.
Make the changes as mentioned. And I should be able to merge this |
Fixed minor spelling typos and added phrases for clarity. Thanks.