abstract class ApplicationPolicy(T)
- ApplicationPolicy(T)
- Reference
- Object
Overview
The default Pundit policy that all other policies should inherit from.
Should you with to update the default policy definitions, run lucky pundit.init
and override where needed.
Defined in:
pundit/application_policy.crConstructors
-
.new(user : User | Nil, record : T | Nil = nil)
A policy takes in a user that might be nil, as well as an object that may be nil.
Instance Method Summary
-
#create?
Whether or not the
Create
action can be accessed -
#delete?
Whether or not the
Delete
action can be accessed -
#edit?
Whether or not the
Edit
action can be accessed -
#index?
Whether or not the
Index
action can be accessed -
#new?
Whether or not the
New
action can be accessed - #record
-
#show?
Whether or not the
Show
action can be accessed -
#update?
Whether or not the
Update
action can be accessed - #user
Constructor Detail
def self.new(user : User | Nil, record : T | Nil = nil)
#
A policy takes in a user that might be nil, as well as an object that may be nil.
These are available in all policy check methods for access.