Adds API response to /trackers to get the list of all available trackers (#7181).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7877 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2011-11-20 14:17:43 +00:00
parent 8b5b928b92
commit 053adaef52
6 changed files with 97 additions and 3 deletions
+13
View File
@@ -314,6 +314,19 @@ class ApplicationController < ActionController::Base
format.json { head @status }
end
end
# Filter for actions that provide an API response
# but have no HTML representation for non admin users
def require_admin_or_api_request
return true if api_request?
if User.current.admin?
true
elsif User.current.logged?
render_error(:status => 406)
else
deny_access
end
end
# Picks which layout to use based on the request
#