lib/contract/authorize.rb
# Use this authorise method to change authorize_resource cancan if object has query string parameter
Use this authorise method to change authorize_resource cancan if object has query string parameter
Use this authorise method to change authorize_resource cancan if object has query string parameter
def authorize_access(url,param_value=nil)
	    user = User.find(current_user.id)
	    if param_value.present?
	        if param_value.to_s == 'x' || param_value.to_s == 'l' || param_value.to_s == 'm'
		        status = authorize_url("/#{url}?tt=#{param_value.to_s}")
		    elsif param_value.is_a? Integer
		    	status = authorize_url("/#{url}?type=#{param_value.to_i}")
		    else
		    	status = authorize_url("/#{url}")
		   	end
	    else
	        status = authorize_url("/#{url}")
	    end
	    if status == false
	      raise CanCan::AccessDenied
	    end
	end
def authorize_access ( url , param_value = nil ) user = User . find ( current_user . id ) if param_value . present? if param_value . to_s == 'x' || param_value . to_s == 'l' || param_value . to_s == 'm' status = authorize_url ( "/#{url}?tt=#{param_value.to_s}" ) elsif param_value . is_a? Integer status = authorize_url ( "/#{url}?type=#{param_value.to_i}" ) else status = authorize_url ( "/#{url}" ) end else status = authorize_url ( "/#{url}" ) end if status == false raise CanCan :: AccessDenied end end
Use this authorise method to change authorize_resource cancan if object has query string parameter
Use this authorise method to change authorize_resource cancan if object has query string parameter
# if @split_tax_and_non_tax_transaction == 1 # else #   status = authorize_url("/#{url}") # end
url
param_value