Class: ApplicationAuthorizer

Inherits:
Authority::Authorizer show all
Defined in:
lib/generators/templates/application_authorizer.rb

Overview

Other authorizers should subclass this one

Instance Attribute Summary

Attributes inherited from Authority::Authorizer

#resource

Class Method Summary collapse

Methods inherited from Authority::Authorizer

#initialize

Constructor Details

This class inherits a constructor from Authority::Authorizer

Class Method Details

.default(adjective, user) ⇒ Boolean

Any class method from Authority::Authorizer that isn’t overridden will call its authorizer’s default method.

Parameters:

  • adjective; (Symbol)

    example: ‘:creatable`

  • user (Object)
    • whatever represents the current user in your app

Returns:

  • (Boolean)


10
11
12
13
14
# File 'lib/generators/templates/application_authorizer.rb', line 10

def self.default(adjective, user)
  # 'Whitelist' strategy for security: anything not explicitly allowed is
  # considered forbidden.
  false
end