Now that we've added the permissions and authentication class to our user profile
view set let's go ahead and test this in the browser ensure that your Django
development server is running in your vagrant terminal window then head over
to Google Chrome or whatever browser it is you'd like to use and let's enter
HTTP forward slash 127.0.0.1 : 8000 forward slash API
forward slash profile this will take us to the profiles API and as you can see
the profiles that we have in the system are still listed as they were before we
also have the option to create new profiles in the system here this is
because these actions fall within the safe methods list in the Django rest
framework what that means is the action to list objects and create
new objects don't perform any destructive changes to existing objects
in the system therefore we're going to always allow users to be able to list
and create new profiles but what we will restrict is users from modifying other
users profiles when they're not authenticated so if we head over to a
specific profile like the one with ID 1 by adding one to the end of the URL then
you may notice that the option to modify this profile is no longer available
that's because we're not authenticated with this profile and because we're not
authenticated we don't get the option to change it now if we authenticated with
this specific user we would be able to update this profile we can also check
profile with ID two and you see the same thing so we can see that the permissions
are restricting us from being able to modify profiles when we're not
authenticated now let's go ahead and commit our
changes to git and push it up to github load up the terminal and open up the
window that is on the profiles REST API project then type git add dot to add
any new files and then git commit - am and we're going to type added
profiles view set then do git push origin to push it up to github