WEBVTT

00:00.360 --> 00:01.680
Hi everyone.

00:03.040 --> 00:06.840
If you remember, is the boss is at the post office.

00:07.880 --> 00:12.600
We have a file on method and what I want to do right now.

00:13.560 --> 00:17.120
I want it will handle the privacy.

00:17.680 --> 00:18.240
Okay.

00:18.960 --> 00:22.240
We haven't handle that yet.

00:23.040 --> 00:23.600
Right.

00:24.880 --> 00:28.160
So in this video, let's step by step and do that.

00:28.560 --> 00:34.240
If you remember inside the box what we have, we have some privacy okay.

00:34.400 --> 00:38.080
With the public private and friends okay.

00:38.320 --> 00:41.240
And by default it will be public.

00:43.240 --> 00:47.920
So in this video I will write a little bit of code to.

00:49.960 --> 00:53.560
Handle the privacy okay.

00:53.600 --> 00:59.360
Inside the very object right here I will put um.

01:04.100 --> 01:06.100
I removed our operator.

01:07.820 --> 01:13.540
And right here I will handle privacy for library public.

01:15.460 --> 01:18.020
Alright, here, we should wrap it inside the object.

01:18.420 --> 01:18.700
Okay.

01:18.700 --> 01:26.620
I feel like we need to handle workplace privacy, but place the variable here will be become true and

01:26.620 --> 01:28.140
it will handle everything.

01:28.820 --> 01:29.340
Okay.

01:29.900 --> 01:32.300
And the next one will be privacy.

01:37.580 --> 01:38.460
Friends.

01:38.660 --> 01:40.860
Okay, I will show you table correct.

01:41.140 --> 01:41.940
Friends.

01:42.060 --> 01:42.620
Okay.

01:43.460 --> 01:45.860
And with the friend we want to handle.

01:47.900 --> 01:48.620
Something.

01:51.100 --> 01:53.300
Let me take a look at the box schema.

01:53.300 --> 01:57.340
We have of course in the author we have a user document.

01:57.740 --> 02:00.990
And inside the user we have a friends Times.

02:01.030 --> 02:01.470
All right.

02:01.470 --> 02:02.070
Over here.

02:02.630 --> 02:11.670
So right here I will put across and I will use the in operator with frame in this list over here.

02:12.670 --> 02:19.750
And I will create the frame list normally and right here if the privacy.

02:23.510 --> 02:34.830
Here are private and we should handle the authors, we will call the user.

02:38.270 --> 02:40.710
ID okay.

02:40.750 --> 02:41.430
Like that.

02:42.630 --> 02:46.990
And let me explain for you what actually happened in the safari right here.

02:46.990 --> 02:48.590
This is the Or operator.

02:49.150 --> 02:51.590
It will match only one case okay.

02:51.630 --> 02:55.590
If this is a public okay this will be true.

02:56.110 --> 03:00.110
And the query we will find on add user.

03:00.590 --> 03:09.450
But if it is the frame we need to filter by the author ID to the frame of authors.

03:09.490 --> 03:11.450
Let me show you what exactly that means.

03:14.570 --> 03:20.290
We need to find the frame of the authors.

03:20.450 --> 03:22.290
Okay, that is me.

03:22.850 --> 03:30.730
And if privacy will be private, we only allow the author can see that spot, right?

03:32.570 --> 03:37.570
So only hover can say dashboard.

03:37.730 --> 03:39.770
And let me find the frame IDs.

03:39.810 --> 03:41.250
Let me try that.

03:42.410 --> 03:47.970
In order to do that, we should inject the user submit.

03:48.250 --> 03:48.650
Okay.

03:48.690 --> 03:53.170
If you remember inside the user submit over here we have.

03:55.490 --> 03:56.290
The file.

03:58.330 --> 04:01.090
File one method over here right.

04:01.790 --> 04:04.430
We can inject and re-use this thing.

04:06.430 --> 04:07.230
Let me show you.

04:07.270 --> 04:08.830
Insert the post module.

04:08.830 --> 04:12.470
We should import the user module.

04:16.590 --> 04:17.670
Insert the video here.

04:17.670 --> 04:21.230
I will private user save it.

04:25.110 --> 04:27.670
And from users of width right here.

04:30.590 --> 04:31.910
I will call.

04:34.230 --> 04:34.990
User.

04:35.430 --> 04:48.830
Why this dot user dot file one with the current user underscore array dot okay.

04:50.510 --> 04:57.510
And right here we need to call the frame friends of context.

04:59.350 --> 05:00.110
Like this.

05:00.150 --> 05:03.640
Okay let me call for an outhouse.

05:03.680 --> 05:08.520
And over here I'm going to use a dot frames.

05:10.000 --> 05:10.520
Okay.

05:11.240 --> 05:26.160
Dot map V is for my frame dot a dot two string okay I will return the ID and we will move over here.

05:27.960 --> 05:28.480
Okay.

05:28.520 --> 05:32.080
That is let me take this further.

05:32.080 --> 05:34.080
You can try to click on the user.

05:34.240 --> 05:39.000
You will say we have a two account uh, from uh.

05:39.240 --> 05:40.040
My mistake.

05:40.040 --> 05:41.800
I already removed the Tomas.

05:42.360 --> 05:42.880
Okay.

05:44.240 --> 05:45.400
That's my mistake.

05:45.400 --> 05:47.280
I don't know why I remove that.

05:47.720 --> 05:52.560
Maybe I test something and I already removed us, and I don't know.

05:53.280 --> 06:00.880
So, uh, right now we only have a zone, and, uh, over here.

06:01.520 --> 06:02.000
Okay.

06:02.060 --> 06:03.820
so this will be the frame.

06:04.420 --> 06:04.900
Okay.

06:05.100 --> 06:10.780
Let me rename it a little bit for easier to to understand.

06:11.900 --> 06:14.380
I will call this guy will be uh.

06:19.220 --> 06:20.860
Maria okay.

06:21.860 --> 06:25.460
And the name will be Maria okay.

06:30.700 --> 06:35.180
Right now the zone and Maria is offering.

06:35.740 --> 06:36.260
Right.

06:37.740 --> 06:45.180
So for that reason, we can, um, we can easily say that.

06:45.540 --> 06:51.260
Let me go back and I will sign in with the zone account.

06:54.100 --> 07:02.790
I will copy this thing, and I will, um, I will create a boss.

07:03.230 --> 07:04.750
Okay, I will create a boss.

07:09.070 --> 07:13.270
I will call new boss for friends.

07:14.830 --> 07:17.750
And right here, what I will say will be friends.

07:18.190 --> 07:22.790
And I will click on authentication and copy the token from zone.

07:23.750 --> 07:24.070
Okay.

07:24.070 --> 07:27.550
It means the author will be zone, right?

07:27.710 --> 07:30.270
We already got a boss over here.

07:30.950 --> 07:39.510
And when I click on Get Own boss, I will sign with my account to say.

07:47.870 --> 07:48.990
Over here and said.

07:51.030 --> 07:58.430
Now I already said privacy will be friend and the own public over here.

07:59.190 --> 07:59.830
Very cool.

07:59.870 --> 08:00.350
Right?

08:01.310 --> 08:04.770
But right now, what happens if I create another account?

08:06.770 --> 08:08.410
I will create a new account.

08:08.450 --> 08:10.370
Maybe it will be Thomas right now.

08:11.450 --> 08:14.090
And Thomas, I will say.

08:15.570 --> 08:21.850
And I will go with the access token and I will click on get on post.

08:24.530 --> 08:33.770
And I say, now you can say you you only can say the privacy will be public.

08:33.810 --> 08:34.330
Okay.

08:34.730 --> 08:38.330
You cannot say privacy will be friend right now.

08:39.210 --> 08:41.730
So it means we are correct, right?

08:42.210 --> 08:46.290
And let me handle the private case.

08:46.890 --> 08:47.170
Okay.

08:47.210 --> 08:50.610
I will say in which the zone account again.

08:56.930 --> 08:58.130
And create the post.

08:58.810 --> 09:03.310
And right here I will call in the privacy.

09:13.310 --> 09:13.670
Of.

09:16.550 --> 09:17.270
This sea.

09:20.270 --> 09:21.430
Of privacy.

09:22.590 --> 09:23.110
Boss.

09:23.990 --> 09:24.670
Let me say.

09:26.590 --> 09:27.350
Uh oh.

09:27.350 --> 09:27.710
Sorry.

09:27.750 --> 09:28.830
This is private.

09:29.350 --> 09:30.070
Private.

09:31.030 --> 09:31.550
Private.

09:31.550 --> 09:32.030
Boss.

09:32.510 --> 09:33.190
Let me say.

09:34.030 --> 09:34.390
Okay.

09:34.390 --> 09:36.430
We already got, uh.

09:36.430 --> 09:38.790
The privacy will be private.

09:39.430 --> 09:41.390
And if we get on with.

09:41.710 --> 09:43.790
This, is the Thomas account, right?

09:44.950 --> 09:46.270
We for sure will.

09:46.350 --> 09:46.990
Don't say.

09:47.630 --> 09:49.470
And let me sign in with the friend.

09:49.470 --> 09:53.830
Account will be Maria and I will.

09:53.830 --> 09:54.950
Don't see also.

09:55.790 --> 09:56.270
Right.

09:56.790 --> 10:00.030
Because this is private, only the author can say.

10:00.390 --> 10:02.710
Let me say okay.

10:02.800 --> 10:04.840
We only see the frame over here.

10:05.600 --> 10:09.120
And right now, let me sign in with the author.

10:09.120 --> 10:11.160
Account will be resolved.

10:23.400 --> 10:27.400
So right now we already see this is the private.

10:27.440 --> 10:27.880
Right.

10:27.880 --> 10:33.160
But could it mean we already handled correctly for the file own method.

10:33.840 --> 10:41.520
And now let's apply the curl for file one method okay.

10:41.560 --> 10:42.440
You can do that.

10:42.760 --> 10:48.120
But, uh I think this doesn't really matter with file method right now.

10:48.840 --> 10:51.120
The best way is for the file own.

10:51.240 --> 10:54.720
But if you want to apply feel free to do that.

10:54.760 --> 10:55.200
Okay.

10:56.720 --> 11:00.320
That is for that or for the job of this thing.

11:00.800 --> 11:03.320
And I will see you in the next one.
