# #49 gem Pundit for Authorization - Complete Guide

- URL: https://superails.com/posts/ruby-on-rails-49-gem-pundit-for-authorization-complete-guide
- Published: 2021-08-05
- Duration: 17:18
- Access: free

Restrict access to different views and actions in your application based on users roles.

Episode source code:
https://github.com/corsego/49-gem-pundit/commit/3e3c65d8b6deaf382dea5ce554c732e85731d6d2
My text notes for this episode:
https://blog.corsego.com/complete-guide-to-gem-pundit
Gem pundit source code:
https://github.com/varvet/pundit

0:00 Authorization without a gem
2:20 Install gem Pundit, basic usage
7:10 User Policy - only admin can edit
10:22 Create Post Policy
11:50 Pundit Scopes
14:10 Authorization conditions in views
16:34 Summary

## Chapters

- 0:00 Authorization without a gem
- 2:20 Install gem Pundit, basic usage
- 7:10 User Policy - only admin can edit
- 10:22 Create Post Policy
- 11:50 Pundit Scopes
- 14:10 Authorization conditions in views
- 16:34 Summary
