Current section: Permissions 6 exercises

Role-Based Access Control with Prisma

Loading exercise


00:00 Let's get started by updating our Prisma schema. So we need to add a permissions table and a roles table or model so that we can create this role-based access control. This is going to be a many-to-many. A user can have many roles and roles can be assigned to many users.

00:19 Then we're going to have a many-to-many on the roles and permissions as well. So a role can have many permissions and a permission can be assigned to many roles. So this is going to be a little interesting because Prisma is going to create for us a special table to manage these relationships, but you don't have to worry about that.

00:38 Just follow the instructions and you should be able to successfully create these many-to-many relationships with the permission and role models. So have a good time with that. We'll see you when you're done.