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

Update access-control.rst #69

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mchesler613
Copy link

Fixed minor spelling typos and added phrases for clarity. Thanks.

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.
Copy link
Collaborator

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.
Copy link
Collaborator

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.
Copy link
Collaborator

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.
Copy link
Collaborator

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.
Copy link
Collaborator

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.

@yvsssantosh
Copy link
Collaborator

Make the changes as mentioned. And I should be able to merge this

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

Successfully merging this pull request may close these issues.

2 participants