Sync with trunk r1778.

git-svn-id: http://redmine.rubyforge.org/svn/branches/work@1779 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2008-08-31 16:45:46 +00:00
parent ef83abe725
commit 068448d734
43 changed files with 161 additions and 24 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