Role-Based Access Control Using Dependency Injection (User Roles) - FastAPI Beyond CRUD (Part 13)

preview_player
Показать описание
Role-Based Access Control Using Dependency Injection
In this video, we’re setting up role-based access control for our API project. Role-based authentication controls who can do what based on their role in the app. We create roles for users and admins, and then check these roles for every API endpoint. This way, we protect our API endpoints so only users with the right role can do certain things. We use dependency injection to make sure everything runs smoothly.

#python #fastapi #apidevelopment

SOURCE CODE:

COURSE WEBSITE:

PLEASE DONATE TO THE CHANNEL THROUGH:
BUY ME A COFFEE:

PATREON:

You can also consider Becoming a member of this channel.

FOLLOW ME:

X:

GITHUB:

Timestamps:
(00:00:00) Introduction
(00:02:08) Get current user
(00:12:43) Add roles to users
(00:19:28) Implementing a role checker dependency
(00:25:29) Add role checker to API paths
Рекомендации по теме
Комментарии
Автор

Hey guys, How do you feel about our progress into the series, Kindly let me know in the comment section. Also, please click the like button.

SsaliJonathan
Автор

I was waiting
Thank you @Jonathan
This part about access control (JWT, Revoking Tokens, Role-base access) are very interesting for me.
The logic and progression are well thought
Just keep it going 😃

suen-tech
Автор

Hi janathan, my question is "is this course only used sqlmodel instead of sqlalchemy with fastapi"

souravdey
Автор

Who also noticed chicken noises in the background at 23:45

braveltd
Автор

Can you share video on Roles & Permission Groups and we can set restriction via both role & permissons

me_jd_solanki
Автор

Her users can acess how impliment admin i mean a page or url only for admin how can implement it

hoocx
join shbcf.ru