How to set access permission ?
Added by shamith c over 12 years ago
Hi create a patch file for Issue controller, I defined a before filter create_with_bfr_cr. Please check my code
require_dependency 'issues_controller'
module IssueCreatePatch
def self.included(base)
base.send(:include, InstanceMethods)
base.class_eval do
#alias_method_chain :create, :bfr_cr
before_filter :create_with_bfr_cr, :only =>'show'
end
end
module InstanceMethods
def create_with_bfr_cr
issue = Issue.find(params[:id])
#-------some codes here-------------
end
end
end
IssuesController.send(:include, IssueCreatePatch)
It is working correctly. Now I want to set permission in administrative page.
ie,
Admin can set permission only to developer to execute before filter.
How to achieve it ?
I