Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
8670411a
Commit
8670411a
authored
Feb 03, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean Ci::ApplicationController from unused permission related code
parent
627909c2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
50 deletions
+2
-50
app/controllers/ci/application_controller.rb
app/controllers/ci/application_controller.rb
+0
-47
app/controllers/ci/projects_controller.rb
app/controllers/ci/projects_controller.rb
+2
-3
No files found.
app/controllers/ci/application_controller.rb
View file @
8670411a
...
...
@@ -3,52 +3,5 @@ module Ci
def
self
.
railtie_helpers_paths
"app/helpers/ci"
end
private
def
authorize_access_project!
unless
can?
(
current_user
,
:read_project
,
project
)
return
page_404
end
end
def
authorize_manage_builds!
unless
can?
(
current_user
,
:update_build
,
project
)
return
page_404
end
end
def
authenticate_admin!
return
render_404
unless
current_user
.
is_admin?
end
def
authorize_manage_project!
unless
can?
(
current_user
,
:admin_project
,
project
)
return
page_404
end
end
def
page_404
render
file:
"
#{
Rails
.
root
}
/public/404.html"
,
status:
404
,
layout:
false
end
def
default_headers
headers
[
'X-Frame-Options'
]
=
'DENY'
headers
[
'X-XSS-Protection'
]
=
'1; mode=block'
end
# JSON for infinite scroll via Pager object
def
pager_json
(
partial
,
count
)
html
=
render_to_string
(
partial
,
layout:
false
,
formats:
[
:html
]
)
render
json:
{
html:
html
,
count:
count
}
end
end
end
app/controllers/ci/projects_controller.rb
View file @
8670411a
module
Ci
class
ProjectsController
<
Ci
::
ApplicationController
before_action
:project
,
except:
[
:index
]
before_action
:authenticate_user!
,
except:
[
:index
,
:build
,
:badge
]
before_action
:authorize_access_project!
,
except:
[
:index
,
:badge
]
before_action
:project
before_action
:authorize_read_project!
,
except:
[
:badge
]
before_action
:no_cache
,
only:
[
:badge
]
protect_from_forgery
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment