Adds cross-project time reports support (#994).

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1778 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2008-08-31 16:34:54 +00:00
parent dbad26c87d
commit 696d21f8c8
8 changed files with 100 additions and 20 deletions
+5 -1
View File
@@ -95,11 +95,15 @@ class ApplicationController < ActionController::Base
end
true
end
def deny_access
User.current.logged? ? render_403 : require_login
end
# Authorize the user for the requested action
def authorize(ctrl = params[:controller], action = params[:action])
allowed = User.current.allowed_to?({:controller => ctrl, :action => action}, @project)
allowed ? true : (User.current.logged? ? render_403 : require_login)
allowed ? true : deny_access
end
# make sure that the user is a member of the project (or admin) if project is private