WEBVTT

00:00.440 --> 00:02.080
Hi everyone.

00:02.720 --> 00:08.480
In this video, let's add the authorization for the command controller.

00:09.040 --> 00:09.560
Okay.

00:10.040 --> 00:10.760
Right here.

00:11.480 --> 00:17.480
After with authentication, we will put the raw raw over here.

00:18.280 --> 00:22.040
And with the create file on get.

00:22.080 --> 00:24.600
And here we don't list okay.

00:24.800 --> 00:33.760
We don't need any authorization because everyone only need to authentication can be performed this action

00:34.000 --> 00:34.520
right.

00:34.800 --> 00:37.920
But without that I want to add a row.

00:39.640 --> 00:45.240
The rows will be admin and user okay.

00:45.280 --> 00:52.320
The admin can update every command and user can update each on command.

00:52.360 --> 00:52.880
Right.

00:53.640 --> 00:55.000
And here will be also.

00:59.080 --> 01:03.190
And same Think we already used that.

01:03.230 --> 01:07.510
Make sure we update the resource service.

01:07.550 --> 01:08.030
Okay.

01:08.430 --> 01:13.470
Right now let me inject the command.

01:16.030 --> 01:17.030
Command model.

01:22.110 --> 01:24.230
And it will error.

01:24.270 --> 01:24.750
Right.

01:28.110 --> 01:30.430
Over the module we import.

01:32.950 --> 01:33.550
Command.

01:36.990 --> 01:38.590
In command schema.

01:42.350 --> 01:42.870
Okay.

01:43.470 --> 01:45.950
That is an insight here.

01:46.990 --> 01:48.870
Command is not defined.

01:49.830 --> 01:51.390
Let me click over here.

01:54.230 --> 01:55.070
Somewhere.

01:55.230 --> 01:58.070
Oh let me import module.

01:58.070 --> 01:59.350
We import correctly.

02:10.910 --> 02:11.430
Okay.

02:11.470 --> 02:18.550
After that we to create another case will be for command.

02:23.830 --> 02:24.870
Restore ID.

02:30.270 --> 02:31.310
From file.

02:32.270 --> 02:40.110
And right here we will return the ID right command dot.

02:42.350 --> 02:44.950
Now if you look at the command.

02:47.030 --> 02:52.310
Schema you will say we have a user command field okay.

02:52.350 --> 02:58.670
We will rely on that field dot underscore ID string.

02:59.510 --> 03:01.140
That is Okay.

03:01.340 --> 03:04.540
We just need to modify the resource service.

03:06.460 --> 03:08.540
And let's take this.

03:10.820 --> 03:11.460
Right here.

03:12.100 --> 03:20.700
Uh, for example, right now I will go and I will sign in with the different account.

03:22.900 --> 03:24.980
And I will copy the access token.

03:25.460 --> 03:25.980
Right.

03:26.260 --> 03:32.940
And I will try to delete uh I will try to get command first.

03:35.300 --> 03:37.260
I'm going to command and I will delete.

03:37.820 --> 03:38.300
Okay.

03:38.540 --> 03:41.820
With the list I will copy the access token over here.

03:46.100 --> 03:48.020
And run here.

03:48.420 --> 03:48.900
Delete.

03:49.300 --> 03:55.940
And in here let me try to release this thing.

03:56.420 --> 03:59.980
Try to release the command over here.

04:00.740 --> 04:01.260
Let's see.

04:02.340 --> 04:02.740
Okay.

04:02.780 --> 04:05.300
You only can access your own resource.

04:05.540 --> 04:05.900
Okay.

04:05.940 --> 04:06.740
Very, very good.

04:06.740 --> 04:07.060
Right.

04:09.220 --> 04:11.980
And I'm sure it will work without that.

04:12.620 --> 04:12.900
Right.

04:12.900 --> 04:17.500
Now, let me try to create a new command with the current users.

04:20.580 --> 04:21.420
Access token.

04:22.620 --> 04:26.860
Both the here and create a command.

04:27.940 --> 04:28.580
Right.

04:28.980 --> 04:29.980
Create a command.

04:30.300 --> 04:31.500
Say okay.

04:31.900 --> 04:32.540
After here.

04:32.580 --> 04:34.340
Let me try to delete it.

04:36.220 --> 04:37.060
It work.

04:37.380 --> 04:40.060
It mean we already got right.

04:40.740 --> 04:41.140
Okay.

04:41.180 --> 04:43.540
It already remove correctly.

04:43.820 --> 04:44.340
So that.

04:44.340 --> 04:46.740
Is that about the authorization.

04:47.580 --> 04:55.060
And it very easy since we already set up everything at the beginning right.

04:55.300 --> 04:57.180
So I hope you enjoyed.

04:57.940 --> 05:00.860
Right now I will see you in the.
