Sha256: 697f8c70dd7c8ae43968a173583d32cae820172580cb93fa64554134c68ead84

Contents?: true

Size: 577 Bytes

Versions: 4

Compression:

Stored size: 577 Bytes

Contents

# Other authorizers should subclass this one
class ApplicationAuthorizer < Authority::Authorizer

  # Any class method from Authority::Authorizer that isn't overridden
  # will call its authorizer's default method. 
  #
  # @param [Symbol] adjective; example: `:creatable`
  # @param [Object] user - whatever represents the current user in your app
  # @return [Boolean]
  def self.default(adjective, user)
    # 'Whitelist' strategy for security: anything not explicitly allowed is
    # considered forbidden.
    
    # default was false
    user.has_role? :admin
  end

end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
mix-rails-0.26.3 mix-rails-core/app/authorizers/application_authorizer.rb
mix-rails-core-0.26.3 app/authorizers/application_authorizer.rb
mix-rails-0.26.2 mix-rails-core/app/authorizers/application_authorizer.rb
mix-rails-core-0.26.2 app/authorizers/application_authorizer.rb