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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
13d2d198
Commit
13d2d198
authored
Feb 12, 2019
by
Vladimir Shushlin
Committed by
Grzegorz Bizon
Feb 12, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix access to pages domain settings
parent
a68ff6d6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
2 deletions
+22
-2
app/controllers/projects/pages_domains_controller.rb
app/controllers/projects/pages_domains_controller.rb
+1
-1
changelogs/unreleased/54850-pages-domain-show-view-is-not-protected-by-access-control.yml
...s-domain-show-view-is-not-protected-by-access-control.yml
+5
-0
spec/controllers/projects/pages_domains_controller_spec.rb
spec/controllers/projects/pages_domains_controller_spec.rb
+16
-1
No files found.
app/controllers/projects/pages_domains_controller.rb
View file @
13d2d198
...
@@ -4,7 +4,7 @@ class Projects::PagesDomainsController < Projects::ApplicationController
...
@@ -4,7 +4,7 @@ class Projects::PagesDomainsController < Projects::ApplicationController
layout
'project_settings'
layout
'project_settings'
before_action
:require_pages_enabled!
before_action
:require_pages_enabled!
before_action
:authorize_update_pages!
,
except:
[
:show
]
before_action
:authorize_update_pages!
before_action
:domain
,
except:
[
:new
,
:create
]
before_action
:domain
,
except:
[
:new
,
:create
]
def
show
def
show
...
...
changelogs/unreleased/54850-pages-domain-show-view-is-not-protected-by-access-control.yml
0 → 100644
View file @
13d2d198
---
title
:
Require maintainer access to show pages domain settings
merge_request
:
24926
author
:
type
:
fixed
spec/controllers/projects/pages_domains_controller_spec.rb
View file @
13d2d198
...
@@ -23,12 +23,27 @@ describe Projects::PagesDomainsController do
...
@@ -23,12 +23,27 @@ describe Projects::PagesDomainsController do
end
end
describe
'GET show'
do
describe
'GET show'
do
it
"displays the 'show' page"
do
def
make_request
get
(
:show
,
params:
request_params
.
merge
(
id:
pages_domain
.
domain
))
get
(
:show
,
params:
request_params
.
merge
(
id:
pages_domain
.
domain
))
end
it
"displays the 'show' page"
do
make_request
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
response
).
to
render_template
(
'show'
)
expect
(
response
).
to
render_template
(
'show'
)
end
end
context
'when user is developer'
do
before
do
project
.
add_developer
(
user
)
end
it
'renders 404 page'
do
make_request
expect
(
response
).
to
have_gitlab_http_status
(
404
)
end
end
end
end
describe
'GET new'
do
describe
'GET new'
do
...
...
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