From 96d49bf04ce77c975fe500f4d961e4a1ffed4c26 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Sun, 30 Dec 2012 14:43:00 +0200 Subject: Use sdoc to generate application code documentation --- doc/code/classes/ApplicationController.html | 942 ++++++++++++++++++++++++++++ 1 file changed, 942 insertions(+) create mode 100644 doc/code/classes/ApplicationController.html (limited to 'doc/code/classes/ApplicationController.html') diff --git a/doc/code/classes/ApplicationController.html b/doc/code/classes/ApplicationController.html new file mode 100644 index 00000000000..f1c3bed954e --- /dev/null +++ b/doc/code/classes/ApplicationController.html @@ -0,0 +1,942 @@ + + + + + ApplicationController + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + +
Methods
+
+ +
A
+
+ +
+ +
C
+
+
    + + +
  • + can? +
  • + +
+
+ +
D
+
+ +
+ +
G
+
+ +
+ +
L
+
+ +
+ +
M
+
+ +
+ +
N
+
+ +
+ +
P
+
+ +
+ +
R
+
+ +
+ +
S
+
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + +
Instance Protected methods
+ +
+
+ + abilities() + + +
+ + +
+ +
+ + + + + + +
+ + +
+
# File app/controllers/application_controller.rb, line 58
+def abilities
+  @abilities ||= Six.new
+end
+
+
+ +
+ +
+
+ + access_denied!() + + +
+ + +
+ +
+ + + + + + +
+ + +
+
# File app/controllers/application_controller.rb, line 91
+def access_denied!
+  render "errors/access_denied", layout: "errors", status: 404
+end
+
+
+ +
+ +
+
+ + add_abilities() + + +
+ + +
+ +
+ + + + + + +
+ + +
+
# File app/controllers/application_controller.rb, line 79
+def add_abilities
+  abilities << Ability
+end
+
+
+ +
+ +
+
+ + after_sign_in_path_for(resource) + + +
+ + +
+ +
+ + + + + + +
+ + +
+
# File app/controllers/application_controller.rb, line 43
+def after_sign_in_path_for resource
+  if resource.is_a?(User) && resource.respond_to?(:blocked) && resource.blocked
+    sign_out resource
+    flash[:alert] = "Your account is blocked. Retry when an admin unblock it."
+    new_user_session_path
+  else
+    super
+  end
+end
+
+
+ +
+ +
+
+ + authorize_code_access!() + + +
+ + +
+ +
+ + + + + + +
+ + +
+
# File app/controllers/application_controller.rb, line 87
+def authorize_code_access!
+  return access_denied! unless can?(current_user, :download_code, project)
+end
+
+
+ +
+ +
+
+ + authorize_project!(action) + + +
+ + +
+ +
+ + + + + + +
+ + +
+
# File app/controllers/application_controller.rb, line 83
+def authorize_project!(action)
+  return access_denied! unless can?(current_user, action, project)
+end
+
+
+ +
+ +
+
+ + can?(object, action, subject) + + +
+ + +
+ +
+ + + + + + +
+ + +
+
# File app/controllers/application_controller.rb, line 62
+def can?(object, action, subject)
+  abilities.allowed?(object, action, subject)
+end
+
+
+ +
+ +
+
+ + dev_tools() + + +
+ + +
+ +
+ + + + + + +
+ + +
+
# File app/controllers/application_controller.rb, line 129
+def dev_tools
+  Rack::MiniProfiler.authorize_request
+end
+
+
+ +
+ +
+
+ + git_not_found!() + + +
+ + +
+ +
+ + + + + + +
+ + +
+
# File app/controllers/application_controller.rb, line 99
+def git_not_found!
+  render "errors/git_not_found", layout: "errors", status: 404
+end
+
+
+ +
+ +
+
+ + log_exception(exception) + + +
+ + +
+ +
+ + + + + + +
+ + +
+
# File app/controllers/application_controller.rb, line 29
+def log_exception(exception)
+  application_trace = ActionDispatch::ExceptionWrapper.new(env, exception).application_trace
+  application_trace.map!{ |t| "  #{t}\n" }
+  logger.error "\n#{exception.class.name} (#{exception.message}):\n#{application_trace.join}"
+end
+
+
+ +
+ +
+
+ + method_missing(method_sym, *arguments, &block) + + +
+ + +
+ +
+ + + + + + +
+ + +
+
# File app/controllers/application_controller.rb, line 103
+def method_missing(method_sym, *arguments, &block)
+  if method_sym.to_s =~ %r^authorize_(.*)!$/
+    authorize_project!($1.to_sym)
+  else
+    super
+  end
+end
+
+
+ +
+ +
+
+ + no_cache_headers() + + +
+ + +
+ +
+ + + + + + +
+ + +
+
# File app/controllers/application_controller.rb, line 123
+def no_cache_headers
+  response.headers["Cache-Control"] = "no-cache, no-store, max-age=0, must-revalidate"
+  response.headers["Pragma"] = "no-cache"
+  response.headers["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT"
+end
+
+
+ +
+ +
+
+ + not_found!() + + +
+ + +
+ +
+ + + + + + +
+ + +
+
# File app/controllers/application_controller.rb, line 95
+def not_found!
+  render "errors/not_found", layout: "errors", status: 404
+end
+
+
+ +
+ +
+
+ + project() + + +
+ + +
+ +
+ + + + + + +
+ + +
+
# File app/controllers/application_controller.rb, line 66
+def project
+  id = params[:project_id] || params[:id]
+
+  @project = Project.find_with_namespace(id)
+
+  if @project and can?(current_user, :read_project, @project)
+    @project
+  else
+    @project = nil
+    render_404
+  end
+end
+
+
+ +
+ +
+
+ + reject_blocked!() + + +
+ + +
+ +
+ + + + + + +
+ + +
+
# File app/controllers/application_controller.rb, line 35
+def reject_blocked!
+  if current_user && current_user.blocked
+    sign_out current_user
+    flash[:alert] = "Your account is blocked. Retry when an admin unblock it."
+    redirect_to new_user_session_path
+  end
+end
+
+
+ +
+ +
+
+ + render_403() + + +
+ + +
+ +
+ + + + + + +
+ + +
+
# File app/controllers/application_controller.rb, line 115
+def render_403
+  render file: Rails.root.join("public", "403"), layout: false, status: "403"
+end
+
+
+ +
+ +
+
+ + render_404() + + +
+ + +
+ +
+ + + + + + +
+ + +
+
# File app/controllers/application_controller.rb, line 111
+def render_404
+  render file: Rails.root.join("public", "404"), layout: false, status: "404"
+end
+
+
+ +
+ +
+
+ + require_non_empty_project() + + +
+ + +
+ +
+ + + + + + +
+ + +
+
# File app/controllers/application_controller.rb, line 119
+def require_non_empty_project
+  redirect_to @project if @project.empty_repo?
+end
+
+
+ +
+ +
+
+ + set_current_user_for_observers() + + +
+ + +
+ +
+ + + + + + +
+ + +
+
# File app/controllers/application_controller.rb, line 53
+def set_current_user_for_observers
+  MergeRequestObserver.current_user = current_user
+  IssueObserver.current_user = current_user
+end
+
+
+ +
+
+ +
+ + \ No newline at end of file -- cgit v1.2.1