OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
openproject/lib/costs_application_controlle...

21 lines
693 B

require_dependency 'application_controller'
module CostsApplicationControllerPatch
def self.included(base) # :nodoc:
base.send(:include, InstanceMethods)
base.class_eval do
alias_method_chain :authorize, :for_user
end
end
module InstanceMethods
# Authorize the user for the requested action
def authorize_with_for_user(ctrl = params[:controller], action = params[:action], global = false, for_user=@user)
allowed = User.current.allowed_to?({:controller => ctrl, :action => action}, @project, :global => global, :for => for_user)
allowed ? true : deny_access
end
end
end
ApplicationController.send(:include, CostsApplicationControllerPatch)