Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2018-02-28 23:28:43 +0300
committerKamil Trzciński <ayufan@ayufan.eu>2018-02-28 23:28:43 +0300
commita2f375e8f74870dcdcfa1c7886bd1c14c80a684e (patch)
tree6b6e3a4f7554f4671edc17d87869dd6916984404 /app/controllers/application_controller.rb
parenta22f6fa6e50bb31921415b01fd345d6802581390 (diff)
parent81852d1f902c2923c239e9c33cab77f5fd6ca8d8 (diff)
Merge remote-tracking branch 'origin/master' into object-storage-ee-to-ce-backport
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r--app/controllers/application_controller.rb11
1 files changed, 8 insertions, 3 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index b04bfaf3e49..e6a41202f04 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -126,10 +126,15 @@ class ApplicationController < ActionController::Base
Ability.allowed?(object, action, subject)
end
- def access_denied!
+ def access_denied!(message = nil)
respond_to do |format|
- format.json { head :not_found }
- format.any { render "errors/access_denied", layout: "errors", status: 404 }
+ format.any { head :not_found }
+ format.html do
+ render "errors/access_denied",
+ layout: "errors",
+ status: 404,
+ locals: { message: message }
+ end
end
end