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:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-03-24 10:09:39 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-03-25 12:42:00 +0300
commit6f894bec097a4cfa378cee908d81f3cba67a09e5 (patch)
tree21220ce4f879ee2408e94530b7c8f0eb2a3c8fd1 /app/controllers/ci
parent63c8a05bf7f18ac4093ece1f08b4b5fd8dba5fac (diff)
Add definition of before action that has been moved
Closes #14528
Diffstat (limited to 'app/controllers/ci')
-rw-r--r--app/controllers/ci/projects_controller.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/controllers/ci/projects_controller.rb b/app/controllers/ci/projects_controller.rb
index 081e01a75e0..c0e7f434ff5 100644
--- a/app/controllers/ci/projects_controller.rb
+++ b/app/controllers/ci/projects_controller.rb
@@ -1,8 +1,8 @@
module Ci
class ProjectsController < Ci::ApplicationController
before_action :project
- before_action :authorize_read_project!, except: [:badge]
before_action :no_cache, only: [:badge]
+ before_action :authorize_read_project!, except: [:badge, :index]
skip_before_action :authenticate_user!, only: [:badge]
protect_from_forgery
@@ -35,5 +35,9 @@ module Ci
response.headers["Pragma"] = "no-cache"
response.headers["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT"
end
+
+ def authorize_read_project!
+ return access_denied! unless can?(current_user, :read_project, project)
+ end
end
end