Module: Facepalm::Rails::Controller::OauthAccess::ClassMethods

Defined in:
lib/facepalm/rails/controller/oauth_access.rb

Instance Method Summary collapse

Instance Method Details

#facepalm_authentication(*permissions) ⇒ Object

Requires Facebook authentication for the whole set of controller actions. Use it to setup a given set of permissions for the whole controller

Examples:

class MyController < ApplicationController
  facepalm_authentication :email, :publish_actions, :only => :index
end

Parameters:

  • permissions

    An array of permissions to require

  • options

    A hash of options to control filter application, similar to options hash for before_filter



36
37
38
39
40
41
42
43
# File 'lib/facepalm/rails/controller/oauth_access.rb', line 36

def facepalm_authentication(*permissions)
  options = permissions.extract_options!

  cattr_accessor :facepalm_authentication_filter
  self.facepalm_authentication_filter = AccessFilter.new(*permissions)

  before_filter(facepalm_authentication_filter, options)
end