Flask role based authorization - Admin endpoints

preview_player
Показать описание
Using role based authorization you can restrict specific endpoints of your API to specific user types.

In this tutorial we associate a role to a user to authorize them to specific endpoints in our Flask API.

Chapters:
0:00 Intro
0:31 Recap
0:46 Role models
8:01 Auth decorator
13:22 Restricting endpoints to admins

Code:

Personal website:
Рекомендации по теме
Комментарии
Автор

Can we use mongodb in this same project of user RBAC ?

sandip_kanzariya
Автор

5:19 db.relationship : i'm a noob in python, so i had to wrap my mind around the function. first arg point to the "class" name, second argument points to the DB table name . I had to put the schema eg secondary="s_user.user_roles" because of my postgresql db design, .... Finally back_populates refer to variable inside the class .I hope i am not saying stupid things and it helps ...thank you for that bright video !

nicolasseydoux
Автор

can this method use to 1 role have many permissions ?

bplayer
Автор

What extensions do you use? you should make a video.

davidastudillo
Автор

круто, очень полезный пример. Спасибо!

kotvkvante