π Part 7 β Authentication & Authorization in Rails
Use Devise:
gem install devise rails generate devise:install rails generate devise User
Role-based access with Pundit:
class PostPolicy < ApplicationPolicy def update? user.admin? || record.user == user end end
Top comments (0)