Class: ApiValve::PermissionHandler
- Inherits:
-
Object
- Object
- ApiValve::PermissionHandler
- Defined in:
- lib/api_valve/permission_handler.rb
Instance Method Summary collapse
-
#allowed? ⇒ Boolean
Run permission checks Simple implementation is always true.
-
#initialize(env, options = {}) ⇒ PermissionHandler
constructor
A new instance of PermissionHandler.
-
#message ⇒ Object
Returns string message why access was denied Rendered on the API.
Constructor Details
#initialize(env, options = {}) ⇒ PermissionHandler
Returns a new instance of PermissionHandler.
3 4 5 6 |
# File 'lib/api_valve/permission_handler.rb', line 3 def initialize(env, = {}) @env = env @options = .with_indifferent_access end |
Instance Method Details
#allowed? ⇒ Boolean
Run permission checks Simple implementation is always true. Override in your implementation.
10 11 12 |
# File 'lib/api_valve/permission_handler.rb', line 10 def allowed? true end |
#message ⇒ Object
Returns string message why access was denied Rendered on the API. Override in your implementation.
17 18 19 |
# File 'lib/api_valve/permission_handler.rb', line 17 def 'Insufficient permissions' end |