AdonisJS - User Role Management Made Simple

Опубликовано: 03 Апрель 2026
на канале: Adocasts
2,577
28

In this lesson, we'll learn how to create a user management screen that'll allow administrators to change any of our registered user's roles. For this, we'll create a role middleware, allowing us to restrict actions to admins. We'll also add the ability to delete users from our application as well.

👍 If You Enjoy This Video, Consider Hitting The Like Button!

🔓 Multi-Model Authentication lesson this is meant to follow up:
   • How To Do Multi Model Authentication with ...  

🥁 Subscribe To Stay Notified For New Lessons:
https://www.youtube.com/adocasts?sub_...

📕 View on Adocasts:
https://adocasts.com/lessons/adonisjs...

👨‍💻 Find The Code For This Lesson Here:
https://github.com/adocasts/user-role...

📚 Chapters:
00:00 - Creating Files
00:28 - User Management Route Handler
01:08 - Creating A Layout
02:04 - User Management View
04:08 - Updating A User's Role
08:15 - Creating A Role Middleware
11:16 - Handling Self-Demotion
13:04 - Deleting Users
16:30 - Wrapping Up

-----------------------------------------

🕸️ Website: https://adocasts.com
🐘 Mastodon: https://fosstodon.org/@adocasts
🐦 Twitter:   / adocasts  
👍 GitHub: https://github.com/adocasts