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
b072fb7f
Commit
b072fb7f
authored
Aug 10, 2021
by
Paul Slaughter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Merge branch 'conditionally-render-create-project-button' into 'master'"
This reverts merge request !64196
parent
ccf11ddb
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1 addition
and
33 deletions
+1
-33
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+0
-2
app/helpers/nav/top_nav_helper.rb
app/helpers/nav/top_nav_helper.rb
+1
-5
spec/controllers/projects_controller_spec.rb
spec/controllers/projects_controller_spec.rb
+0
-26
No files found.
app/controllers/projects_controller.rb
View file @
b072fb7f
...
@@ -54,8 +54,6 @@ class ProjectsController < Projects::ApplicationController
...
@@ -54,8 +54,6 @@ class ProjectsController < Projects::ApplicationController
# rubocop: disable CodeReuse/ActiveRecord
# rubocop: disable CodeReuse/ActiveRecord
def
new
def
new
return
access_denied!
unless
current_user
.
can_create_project?
@namespace
=
Namespace
.
find_by
(
id:
params
[
:namespace_id
])
if
params
[
:namespace_id
]
@namespace
=
Namespace
.
find_by
(
id:
params
[
:namespace_id
])
if
params
[
:namespace_id
]
return
access_denied!
if
@namespace
&&
!
can?
(
current_user
,
:create_projects
,
@namespace
)
return
access_denied!
if
@namespace
&&
!
can?
(
current_user
,
:create_projects
,
@namespace
)
...
...
app/helpers/nav/top_nav_helper.rb
View file @
b072fb7f
...
@@ -267,11 +267,7 @@ module Nav
...
@@ -267,11 +267,7 @@ module Nav
builder
.
add_primary_menu_item
(
id:
'your'
,
title:
_
(
'Your projects'
),
href:
dashboard_projects_path
)
builder
.
add_primary_menu_item
(
id:
'your'
,
title:
_
(
'Your projects'
),
href:
dashboard_projects_path
)
builder
.
add_primary_menu_item
(
id:
'starred'
,
title:
_
(
'Starred projects'
),
href:
starred_dashboard_projects_path
)
builder
.
add_primary_menu_item
(
id:
'starred'
,
title:
_
(
'Starred projects'
),
href:
starred_dashboard_projects_path
)
builder
.
add_primary_menu_item
(
id:
'explore'
,
title:
_
(
'Explore projects'
),
href:
explore_root_path
)
builder
.
add_primary_menu_item
(
id:
'explore'
,
title:
_
(
'Explore projects'
),
href:
explore_root_path
)
if
current_user
.
can_create_project?
builder
.
add_secondary_menu_item
(
id:
'create'
,
title:
_
(
'Create new project'
),
href:
new_project_path
)
builder
.
add_secondary_menu_item
(
id:
'create'
,
title:
_
(
'Create new project'
),
href:
new_project_path
)
end
builder
.
build
builder
.
build
end
end
...
...
spec/controllers/projects_controller_spec.rb
View file @
b072fb7f
...
@@ -42,32 +42,6 @@ RSpec.describe ProjectsController do
...
@@ -42,32 +42,6 @@ RSpec.describe ProjectsController do
expect
(
response
).
not_to
render_template
(
'new'
)
expect
(
response
).
not_to
render_template
(
'new'
)
end
end
end
end
context
'when user is an external user'
do
let_it_be
(
:user
)
{
create
(
:user
,
external:
true
)
}
it
'responds with status 404'
do
group
.
add_owner
(
user
)
get
:new
,
params:
{
namespace_id:
group
.
id
}
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
expect
(
response
).
not_to
render_template
(
'new'
)
end
end
context
'when user is a group guest'
do
let_it_be
(
:user
)
{
create
(
:user
)
}
it
'responds with status 404'
do
group
.
add_guest
(
user
)
get
:new
,
params:
{
namespace_id:
group
.
id
}
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
expect
(
response
).
not_to
render_template
(
'new'
)
end
end
end
end
end
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