Module: MatViews::Admin::DefaultAuth
- Defined in:
- lib/mat_views/admin/default_auth.rb
Overview
MatViews::Admin::DefaultAuth
Development-friendly fallback authentication/authorization for the MatViews admin UI. It is included first by AuthBridge, and is meant to be overridden by a host-provided module (MatViewsAdmin or MatViews::Admin::HostAuth).
❗ **Not for production**: this module allows all access and returns a dummy user.
Defined Under Namespace
Classes: SampleUser
Instance Method Summary collapse
-
#authenticate_mat_views! ⇒ Boolean
Authenticates the current request.
-
#authorize_mat_views!(_action, _record) ⇒ Boolean
Authorizes an action on a record.
-
#mat_views_current_user ⇒ SampleUser
Returns the current user object.
Instance Method Details
#authenticate_mat_views! ⇒ Boolean
Authenticates the current request. Always returns true in the default implementation.
rubocop:disable Naming/PredicateMethod
41 42 |
# File 'lib/mat_views/admin/default_auth.rb', line 41 def authenticate_mat_views! = true # rubocop:enable Naming/PredicateMethod |
#authorize_mat_views!(_action, _record) ⇒ Boolean
Authorizes an action on a record. Always returns true in the default implementation.
rubocop:disable Naming/PredicateMethod
57 58 |
# File 'lib/mat_views/admin/default_auth.rb', line 57 def (_action, _record) = true # rubocop:enable Naming/PredicateMethod |
#mat_views_current_user ⇒ SampleUser
Returns the current user object. In the default implementation this is a SampleUser.
48 |
# File 'lib/mat_views/admin/default_auth.rb', line 48 def mat_views_current_user = SampleUser.new('[email protected]') |