Set up Pundit
This commit is contained in:
parent
5f2b044d80
commit
c8f990e319
2
Gemfile
2
Gemfile
|
@ -109,3 +109,5 @@ gem "omniauth-rails_csrf_protection", "~> 1.0"
|
||||||
gem "net-smtp"
|
gem "net-smtp"
|
||||||
gem "net-imap"
|
gem "net-imap"
|
||||||
gem "net-pop"
|
gem "net-pop"
|
||||||
|
|
||||||
|
gem "pundit", "~> 2.2"
|
||||||
|
|
|
@ -304,6 +304,8 @@ GEM
|
||||||
public_suffix (4.0.7)
|
public_suffix (4.0.7)
|
||||||
puma (6.0.0)
|
puma (6.0.0)
|
||||||
nio4r (~> 2.0)
|
nio4r (~> 2.0)
|
||||||
|
pundit (2.2.0)
|
||||||
|
activesupport (>= 3.0.0)
|
||||||
questiongenerator (1.0.0)
|
questiongenerator (1.0.0)
|
||||||
racc (1.6.0)
|
racc (1.6.0)
|
||||||
rack (2.2.4)
|
rack (2.2.4)
|
||||||
|
@ -550,6 +552,7 @@ DEPENDENCIES
|
||||||
pg
|
pg
|
||||||
pghero
|
pghero
|
||||||
puma
|
puma
|
||||||
|
pundit (~> 2.2)
|
||||||
questiongenerator (~> 1.0)
|
questiongenerator (~> 1.0)
|
||||||
rails (~> 6.1)
|
rails (~> 6.1)
|
||||||
rails-controller-testing
|
rails-controller-testing
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
class ApplicationController < ActionController::Base
|
class ApplicationController < ActionController::Base
|
||||||
|
include Pundit::Authorization
|
||||||
# Prevent CSRF attacks by raising an exception.
|
# Prevent CSRF attacks by raising an exception.
|
||||||
# For APIs, you may want to use :null_session instead.
|
# For APIs, you may want to use :null_session instead.
|
||||||
protect_from_forgery with: :exception
|
protect_from_forgery with: :exception
|
||||||
|
|
Loading…
Reference in New Issue