WEBVTT
Kind: captions
Language: en

00:00:00.030 --> 00:00:05.490
Now that we've added the permissions and authentication class to our user profile

00:00:05.490 --> 00:00:12.059
view set let's go ahead and test this in
the browser ensure that your Django

00:00:12.059 --> 00:00:17.490
development server is running in your
vagrant terminal window then head over

00:00:17.490 --> 00:00:22.170
to Google Chrome or whatever browser it
is you'd like to use and let's enter

00:00:22.170 --> 00:00:29.550
HTTP forward slash 127.0.0.1 : 8000 forward slash API

00:00:29.550 --> 00:00:36.600
forward slash profile this will take us
to the profiles API and as you can see

00:00:36.600 --> 00:00:42.090
the profiles that we have in the system
are still listed as they were before we

00:00:42.090 --> 00:00:45.870
also have the option to create new
profiles in the system here this is

00:00:45.870 --> 00:00:52.469
because these actions fall within the
safe methods list in the Django rest

00:00:52.469 --> 00:00:57.899
framework what that means is the action to list objects and create

00:00:57.899 --> 00:01:03.449
new objects don't perform any destructive changes to existing objects

00:01:03.449 --> 00:01:07.350
in the system therefore we're going to
always allow users to be able to list

00:01:07.350 --> 00:01:12.750
and create new profiles but what we will
restrict is users from modifying other

00:01:12.750 --> 00:01:17.479
users profiles when they're not
authenticated so if we head over to a

00:01:17.479 --> 00:01:24.030
specific profile like the one with ID 1
by adding one to the end of the URL then

00:01:24.030 --> 00:01:29.810
you may notice that the option to modify
this profile is no longer available

00:01:29.810 --> 00:01:35.070
that's because we're not authenticated
with this profile and because we're not

00:01:35.070 --> 00:01:40.020
authenticated we don't get the option to
change it now if we authenticated with

00:01:40.020 --> 00:01:46.490
this specific user we would be able to
update this profile we can also check

00:01:46.490 --> 00:01:51.869
profile with ID two and you see the same
thing so we can see that the permissions

00:01:51.869 --> 00:01:55.530
are restricting us from being able to
modify profiles when we're not

00:01:55.530 --> 00:01:58.890
authenticated
now let's go ahead and commit our

00:01:58.890 --> 00:02:04.469
changes to git and push it up to github
load up the terminal and open up the

00:02:04.469 --> 00:02:11.550
window that is on the profiles REST API
project then type git add dot to add

00:02:11.550 --> 00:02:16.640
any new files and then git commit - am and we're going to type added

00:02:16.640 --> 00:02:28.570
profiles view set then do git push origin to push it up to github

