Module: SimpleCrud::Authorization::Adapter
- Included in:
- ActionPolicyAdapter, CanCanCanAdapter, PunditAdapter
- Defined in:
- lib/simple_crud/authorization/adapter.rb
Overview
Implement to plug in an authorization library other than Pundit (the default, see PunditAdapter).
Instance Method Summary collapse
-
#authorize(controller, record) ⇒ Object
Raise when +controller+'s current user may not act on
record. -
#policy_defined?(model_class) ⇒ Boolean
Called once, when simple_crud_for is invoked, to fail fast if
model_classhas no authorization configured.
Instance Method Details
#authorize(controller, record) ⇒ Object
Raise when +controller+'s current user may not act on record.
9 10 11 |
# File 'lib/simple_crud/authorization/adapter.rb', line 9 def (controller, record) raise NotImplementedError end |
#policy_defined?(model_class) ⇒ Boolean
Called once, when simple_crud_for is invoked, to fail fast if
model_class has no authorization configured.
15 16 17 |
# File 'lib/simple_crud/authorization/adapter.rb', line 15 def policy_defined?(model_class) raise NotImplementedError end |