Sha256: 923a5c9fb3a034cf996e6bfa803c7499726d8bd14dd08bfcbc1734b85a6ffc04

Contents?: true

Size: 679 Bytes

Versions: 17

Compression:

Stored size: 679 Bytes

Contents

require 'commontator/shared_helper'
require 'commontator/security_transgression'

module Commontator
  module ControllerIncludes
    def self.included(base)
      base.helper Commontator::SharedHelper
    end
    
    protected
    
    def commontator_thread_show(commontable)
      user = send Commontator.current_user_method	
      raise SecurityTransgression unless (user.nil? || user.is_commontator)
      
      thread = commontable.thread
      raise SecurityTransgression unless thread.can_be_read_by?(user)
      thread.mark_as_read_for(user)
      @commontator_thread_show = true
    end
  end
end

ActionController::Base.send :include, Commontator::ControllerIncludes

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
commontator-4.0.2 lib/commontator/controller_includes.rb
commontator-2.0.2 lib/commontator/controller_includes.rb
commontator-4.0.1 lib/commontator/controller_includes.rb
commontator-4.0.0 lib/commontator/controller_includes.rb
commontator-2.0.1 lib/commontator/controller_includes.rb
commontator-2.0.0 lib/commontator/controller_includes.rb
commontator-1.1.3 lib/commontator/controller_includes.rb
commontator-1.1.2 lib/commontator/controller_includes.rb
commontator-1.1.1 lib/commontator/controller_includes.rb
commontator-1.1.0 lib/commontator/controller_includes.rb
commontator-1.0.6 lib/commontator/controller_includes.rb
commontator-1.0.5 lib/commontator/controller_includes.rb
commontator-1.0.4 lib/commontator/controller_includes.rb
commontator-1.0.3 lib/commontator/controller_includes.rb
commontator-1.0.2 lib/commontator/controller_includes.rb
commontator-1.0.1 lib/commontator/controller_includes.rb
commontator-1.0.0 lib/commontator/controller_includes.rb