Merge pull request #87 from finnlabs/fix/new_preview_2029

Remove superfluous patch
pull/6827/head
ulferts 11 years ago
commit 1950e0fd10
  1. 4
      lib/open_project/costs/engine.rb
  2. 36
      lib/open_project/costs/patches/application_controller_patch.rb

@ -98,8 +98,8 @@ module OpenProject::Costs
end
end
patches [:WorkPackage, :Project, :Query, :User, :TimeEntry, :Version, :PermittedParams, :ApplicationController,
:ProjectsController, :ApplicationHelper, :UsersHelper]
patches [:WorkPackage, :Project, :Query, :User, :TimeEntry, :Version, :PermittedParams,
:ProjectsController, :ApplicationHelper, :UsersHelper]
assets %w(costs.css costs.js)

@ -1,36 +0,0 @@
#-- copyright
# OpenProject Costs Plugin
#
# Copyright (C) 2009 - 2014 the OpenProject Foundation (OPF)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#++
module OpenProject::Costs::Patches::ApplicationControllerPatch
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 || @projects, :global => global, :for => for_user)
allowed ? true : deny_access
end
end
end
Loading…
Cancel
Save