DEV Community

Ssali Jonathan
Ssali Jonathan

Posted on

Role-Based Access Control Using Dependency Injection (Add User Roles)

In this video, we’re setting up role-based access control for our FastAPI project. Role-based access control control allows users to perform actions in an application basing on their role.

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 implement this.

Top comments (0)

The best way to debug slow web pages cover image

The best way to debug slow web pages

Tools like Page Speed Insights and Google Lighthouse are great for providing advice for front end performance issues. But what these tools can’t do, is evaluate performance across your entire stack of distributed services and applications.

Watch video