Sha256: 0d83047dc13bd0ef5858fe746475ca1c34b5660593701e43b92854f91d2a615b
Contents?: true
Size: 841 Bytes
Versions: 6
Compression:
Stored size: 841 Bytes
Contents
module Commontator class ApplicationController < ActionController::Base before_filter :get_user, :ensure_user cattr_accessor :commontable_url rescue_from SecurityTransgression, :with => lambda { head(:forbidden) } protected def get_user @user = self.send Commontator.current_user_method end def ensure_user raise SecurityTransgression unless (@user && @user.is_commontator) end def get_thread @thread = params[:thread_id].blank? ? \ Commontator::Thread.find(params[:id]) : \ Commontator::Thread.find(params[:thread_id]) raise SecurityTransgression if @thread.commontable.nil? end def set_commontable_url self.commontable_url = @thread.config.commontable_url_proc.call(main_app, @thread.commontable) end end end
Version data entries
6 entries across 6 versions & 1 rubygems