Hey there.
Welcome back.
Now, in this lecture, they're just distributing certain now they have been working on different type
of fields.
We have been working on different type of models.
We created a user reviews, then movies, then different platforms like Netflix streaming platform.
So we have discussed a lot about models, view and everything.
But let us take this lecture and test everything and some data and check out functionality.
So the thing is, I'm going to jump onto my board again and we could discuss our database.
So currently we have a database and called it as a watch list, we can call it a stream, we can call
it as movie anything.
So usually you can call it us, anything.
So this is a watch list.
We took some name.
We talk about different things like title, what is the movie title or pure data.
So we take a name, we take a description, everything.
But here we also take about this streaming platform.
We also take information about the platform.
So on which side this movie or this Web show is present.
So this particular platform is actually an external link to our other database, the model.
And really sorry about my handwriting.
We are just discussing.
So don't worry.
So we created this new streaming platform on.
Then we also started discussing a user can review.
So we also added a review platform, so we added a review option and movie can have multiple reviews.
So what we did is we created a new model called US Review.
Things are doing well.
We started working on this model, if we jumpier.
We started working on this model, we created a model watch list as well as a dream platform, so this
was fine.
Now in our stream platform, it was a static symbol.
We have all the fields and we enter data.
Then we had this review.
So in this review, we have a review title rating and then user info.
So that means we are checking which user is actually adding this review.
So what we are going to do is we are going to connect this review again.
With user database.
So this is a user database and which we have info about user.
So that's how things are working now.
And we did a pretty good job.
We added permissions with this review.
So not everyone can add this review.
And what we need to do is we need to add permission here.
Only admin can add movies.
Why we are building.
I am Liebich.
So.
So if I take an example here, so on MTV admin will be admin or their editor or their staff, only they
can add movies and a regular user can search a movie.
So if they are trying to find anything, they can directly either search her or maybe they have some
home page or they have other movies.
So maybe I'm opening this movie.
They have a specific other than specific ideas.
And that's a.
Now we need to add permission that this can be only added, edited by Aardman.
No one else can do that, so this is the first change that we need to do.
Second thing streaming platform can be added by admin only no one else can do that.
So we need to add this.
Also, reviews can be added by individual users so we can do that.
We have already added this permission only user admin, whichever one they can do that.
Also, we need to add that admin can edit any type of review why, if I think our review is suspicious
or maybe our review is fake, what I can do is I can change its value to false.
So if I jump on my admin side, open any review.
So if I think this review is fake, I can just if this is active, I'm going to enact it and then save.
Maybe if I opened this one so accurately, all the reviews, the active police force, but suppose this
is fake, if I open this one, you can see it's true.
I think this is a fake review I'm going to inactivate.
So later on, what we are going to do is we are going to add filter and only the review which have true
values, which has to value they will be shown.
So admin can edit user generated.
Now we have this user info, we have Tolkan system and everything, so this looks fine till our next
aim is to add filter option.
And then also talk about pagination, so if you have maybe we have hundreds of review, so I just want
10 on each piece.
And then we also need to talk about throttling, so throttling help us to restrict the number of requests
for user content.
So, like, free user can send five request and paid user can send 20 requests and few other things.
So this is our current status and we need to edit a few things.
I hope you got the idea.
So let us start our task with this one, we need to ask permission for admin only and no one can edit
them.
So let me jump here, scroll down to the bottom and start one by one.
So the first thing I'm going to edit is my watch detail.
So what you means?
We want individual elements.
And this should be fine, Get-Rich-Quick should be fine, but for post undelete, we need to specify
permission glass.
So if I get here and if I get all my permissions.
Scroll down a bit.
Now ahead, I can add permission like this, let me call this one jumpier.
So what I'm going to do is I'm going to check my information, I want only add an edit rest everyone
can send get requests.
So I just jump onto my permission, start by admin or read-only.
Yeah, this is the case that I want.
I mean, I read only let me also rename it.
Is Admon or Read-Only?
And if I search.
And this will be man or Read-Only and.
Yeah, that's fine.
So these are the two cases now.
I mean, if you remember this case, what we are doing is we are checking if it's a get request, then
we are just returning and allowing them.
And otherwise, we are checking if the user is staff user.
That's it.
So this is going to be the first case we did pretty well.
Let me jump here now.
Put delete will be in unsafe request.
Only get will be allowed to all users.
Now if I jump onto the second one where we are accessing watchlist now here I think watchlist also.
I need some permission.
That admin can edit rest, everyone are going to read only scroll up a bit here we have streaming platform
again, same guest we need to follow admin cannot arrest everyone will have read-only permission streaming
platform here.
Also, Aardman can edit rest.
Everyone will have read-only permission.
So this looks fine, we will for this part and also for our streaming platform part.
Now, if I scroll above it.
We created something similar, again, with the help of model.
So I also need to our part for this.
Remember, this was the same case, I guess this was streaming platform through April.
And here we are accessing through more than we said.
And I remember them because we have committed them, but we haven't commented d this one as well as
this one.
Yeah, this.
So let me keep them as it is now, if I scroll up a bit here, we have a review user or read only your
review detail.
This is fine.
Anyone can read the review, but only review.
The user can edit it.
I can also use is review user.
So that name will be better.
Let me see if I'm using anywhere else.
Yeah, so is Review Yuzu and Sam, I need to follow here, I'm updating these name.
So this looks fine, we have updated the glass review list, only authenticated users can access this
list.
I think list can be accessed by anyone.
So that should not be a case also, since this is a list only condition, that means it's a get condition
so there will be no issue.
I'm going to come in this one.
Anyone can send a request to removalist.
Then we have this great condition, so create condition only authenticated users should be able to send
this.
So I'm going to copy this one.
And I'm going to add up our mission class as authenticate and user, so that's done, that's the complete
process regarding this, this review, create update and everything.
If I jump back here now with our current project, we now understand that this platform will be added
by admin or our staff, our company staff or whatever you want to see.
Movies can be added by company staff or admin.
Anyone can register user through login link or through registration link.
So this will be anyone.
And once someone is registered, they can review any movie for one time, and that means they can leave
one review for each movie.
And we have already implemented this type of functionality, so the only thing that is remaining right
now is to test them on this bowsman.
What I'm going to do is I'm going to delete all of them for now and now create a new user and do everything
sequentially.
So before that, as an admin, let me log in.
The first thing I'm going to do is I log in as admin.
And then our data for movies and data for streaming shows and yeah, so this is going to be our data
for my watch list, which will be movies as well as streaming platform.
The second thing I'm going to do is register as a user, then login.
Then add two or three reviews, that's it, and then we can move forward towards the next topic.
I hope this letter was helpful because we discussed more about permissions and how we are working with
our current project.
I also recommend to take care about these names like Review, Dyche, detailed, reviewed, Ashlee's
reviewed and cleared because they will be helpful for you to identify it as well as use these.
You are Batten's.
So that's all for this lecture in the next lecture.
We will continue with this particular part and we will add some data log in as Ironmen as well as registered
new user and work on reviews.
I hope this letter was helpful.
Thank you for following and I see you guys in the next one.