WEBVTT 00:01.900 --> 00:03.350 So how did you make out with the challenge? 00:03.370 --> 00:05.230 Hopefully you didn't find it terribly difficult. 00:05.890 --> 00:10.680 Well, in order to make it work, what I did was change basically three files. 00:10.840 --> 00:12.490 The first one is here. 00:12.490 --> 00:14.680 Render don't go on the front end. 00:15.100 --> 00:16.860 And we have this template data. 00:16.870 --> 00:21.370 And this is a struct that contains information that's passed to every single template. 00:21.520 --> 00:24.930 And one of those is if is authenticated, which is an end. 00:25.840 --> 00:31.660 So I could have simply changed what happens down here and add default data. 00:32.050 --> 00:34.840 Where I set TD is a dedicated equal to one. 00:34.840 --> 00:40.290 I could make that the user because that's what we're actually storing in this special value user. 00:41.050 --> 00:41.870 But I didn't do that. 00:41.890 --> 00:43.710 I wanted to make things really clear. 00:44.350 --> 00:51.130 So instead I added another field here and I just called the user ID and I made it an end. 00:53.440 --> 01:03.280 And then down here where I add my default data, I simply added this one TD user ID is equal to app 01:03.310 --> 01:04.240 dot session. 01:06.430 --> 01:14.890 Don't get it, and I handed it the context, our context, and I looked for user I.D. and that populates 01:15.550 --> 01:20.420 and by default that will be set to zero if we don't actually execute this statement. 01:20.440 --> 01:25.900 But again, if you want to be really, really safe or make it clear what's going on, t the user ID 01:25.930 --> 01:26.570 equals zero. 01:28.000 --> 01:34.750 So that was the first file that I changed and the next file that I changed was just in one dash user 01:35.020 --> 01:41.400 page, which HTML and it's right down here in the document add event listener. 01:41.500 --> 01:43.030 I just put an if statement right here. 01:43.750 --> 01:52.600 If ID is not exactly equal to and then since it's an end I just wrapped it in in quotation marks and 01:52.600 --> 01:55.690 I pulled the user I.D. from the default data. 01:57.920 --> 02:07.310 Close my quotes and put some curly brackets around everything and indented for formatting, and that's 02:07.310 --> 02:08.000 all I had to do. 02:08.090 --> 02:11.360 So now if I start my application, maybe start. 02:14.550 --> 02:21.300 And go back to the Web browser and go to the admin page for a menu and choose all users. 02:22.180 --> 02:32.050 And I have to log in the example dot com password, so if I go to the admin menu and choose all users 02:32.290 --> 02:35.790 and click on myself, I should have that forum populated with data. 02:35.800 --> 02:38.610 But this time I should not see the delete button. 02:39.550 --> 02:40.850 And that's exactly what I get. 02:41.020 --> 02:41.470 Perfect. 02:41.500 --> 02:42.620 So that was pretty straightforward. 02:43.360 --> 02:49.030 So now we need to move on to actually capturing the information from this form, calling the backend 02:49.030 --> 02:51.040 API and updating a user. 02:51.210 --> 02:53.830 OK, so we'll get started on that in the next lecture.