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
Tatuya Kamada
gitlab-ce
Commits
bb9c194c
Commit
bb9c194c
authored
Apr 05, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Respond 404 when unauthorized user imports members
parent
c52b5c92
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
app/controllers/projects/project_members_controller.rb
app/controllers/projects/project_members_controller.rb
+1
-1
spec/controllers/projects/project_members_controller_spec.rb
spec/controllers/projects/project_members_controller_spec.rb
+2
-2
No files found.
app/controllers/projects/project_members_controller.rb
View file @
bb9c194c
...
...
@@ -100,7 +100,7 @@ class Projects::ProjectMembersController < Projects::ApplicationController
status
=
@project
.
team
.
import
(
source_project
,
current_user
)
notice
=
status
?
"Successfully imported"
:
"Import failed"
else
notice
=
'Import failed - source project not found!'
return
render_404
end
redirect_to
(
namespace_project_project_members_path
(
project
.
namespace
,
project
),
...
...
spec/controllers/projects/project_members_controller_spec.rb
View file @
bb9c194c
...
...
@@ -41,8 +41,8 @@ describe Projects::ProjectMembersController do
expect
(
project
.
team_members
).
to_not
include
member
end
it
'
pretends that source projects does not exist
'
do
expect
(
response
).
to
set_flash
.
to
/source project not found/
it
'
responds with not found
'
do
expect
(
response
.
status
).
to
eq
404
end
end
end
...
...
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