Sha256: 380b1a7b5b0a19689c86301860f590bc56627912595a50e900bb99c9c42d66b8

Contents?: true

Size: 925 Bytes

Versions: 3

Compression:

Stored size: 925 Bytes

Contents

#*************************************************************************************
# Basic Permission object to cut some duplication.
# ApplicationPermission and ViewTagsPermission inherit from it
#*************************************************************************************
class Portier::BasePermission
  attr_reader :access_denied_message, :application_controller, :current_user

  delegate :params, to: :application_controller
  delegate :request, to: :application_controller

  def initialize(application_controller, current_user)
    @application_controller = application_controller
    @current_user = current_user
    @access_denied_message = nil
  end

  def set_access_denied_message(message)
    @access_denied_message = message

    false
  end

  private

  def controller
    @application_controller
  end

  def controller_name
    request[:controller]
  end

  def options
    @options
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
portier-1.1.1 lib/portier/base_permission.rb
portier-1.1.0 lib/portier/base_permission.rb
portier-1.0.3 lib/portier/base_permission.rb