Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
a09e1d3d
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a09e1d3d
编写于
8月 29, 2016
作者:
J
James Lopez
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Enable import/export back for non-admins
上级
71345998
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
7 addition
and
9 deletion
+7
-9
CHANGELOG
CHANGELOG
+1
-0
app/controllers/import/gitlab_projects_controller.rb
app/controllers/import/gitlab_projects_controller.rb
+0
-5
app/views/projects/new.html.haml
app/views/projects/new.html.haml
+1
-1
doc/user/project/settings/import_export.md
doc/user/project/settings/import_export.md
+2
-1
features/steps/dashboard/new_project.rb
features/steps/dashboard/new_project.rb
+1
-0
spec/features/projects/import_export/import_file_spec.rb
spec/features/projects/import_export/import_file_spec.rb
+2
-2
未找到文件。
CHANGELOG
浏览文件 @
a09e1d3d
...
...
@@ -20,6 +20,7 @@ v 8.13.0 (unreleased)
- Close open merge request without source project (Katarzyna Kobierska Ula Budziszewska)
- Use a ConnectionPool for Rails.cache on Sidekiq servers
- Replace `alias_method_chain` with `Module#prepend`
- Enable GitLab Import/Export for non-admin users.
- Preserve label filters when sorting !6136 (Joseph Frazier)
- Only update issuable labels if they have been changed
- Take filters in account in issuable counters. !6496
...
...
app/controllers/import/gitlab_projects_controller.rb
浏览文件 @
a09e1d3d
class
Import::GitlabProjectsController
<
Import
::
BaseController
before_action
:verify_gitlab_project_import_enabled
before_action
:authenticate_admin!
def
new
@namespace_id
=
project_params
[
:namespace_id
]
...
...
@@ -48,8 +47,4 @@ class Import::GitlabProjectsController < Import::BaseController
:path
,
:namespace_id
,
:file
)
end
def
authenticate_admin!
render_404
unless
current_user
.
is_admin?
end
end
app/views/projects/new.html.haml
浏览文件 @
a09e1d3d
...
...
@@ -72,7 +72,7 @@
=
link_to
"#"
,
class:
'btn js-toggle-button import_git'
do
=
icon
(
'git'
,
text:
'Repo by URL'
)
%div
{
class:
'import_gitlab_project'
}
-
if
gitlab_project_import_enabled?
&&
current_user
.
is_admin?
-
if
gitlab_project_import_enabled?
=
link_to
new_import_gitlab_project_path
,
class:
'btn btn_import_gitlab_project project-submit'
do
=
icon
(
'gitlab'
,
text:
'GitLab export'
)
...
...
doc/user/project/settings/import_export.md
浏览文件 @
a09e1d3d
...
...
@@ -7,7 +7,8 @@
> that of the exporter.
> - For existing installations, the project import option has to be enabled in
> application settings (`/admin/application_settings`) under 'Import sources'.
> You will have to be an administrator to enable and use the import functionality.
> Ask your administrator if you don't see the **GitLab export** button when
> creating a new project.
> - You can find some useful raketasks if you are an administrator in the
> [import_export](../../../administration/raketasks/project_import_export.md)
> raketask.
...
...
features/steps/dashboard/new_project.rb
浏览文件 @
a09e1d3d
...
...
@@ -20,6 +20,7 @@ class Spinach::Features::NewProject < Spinach::FeatureSteps
expect
(
page
).
to
have_link
(
'GitLab.com'
)
expect
(
page
).
to
have_link
(
'Google Code'
)
expect
(
page
).
to
have_link
(
'Repo by URL'
)
expect
(
page
).
to
have_link
(
'GitLab export'
)
end
step
'I click on "Import project from GitHub"'
do
...
...
spec/features/projects/import_export/import_file_spec.rb
浏览文件 @
a09e1d3d
...
...
@@ -86,14 +86,14 @@ feature 'Import/Export - project import integration test', feature: true, js: tr
login_as
(
normal_user
)
end
scenario
'non-admin user is
not
allowed to import a project'
do
scenario
'non-admin user is allowed to import a project'
do
expect
(
Project
.
all
.
count
).
to
be_zero
visit
new_project_path
fill_in
:project_path
,
with:
'test-project-path'
,
visible:
true
expect
(
page
).
not_
to
have_content
(
'GitLab export'
)
expect
(
page
).
to
have_content
(
'GitLab export'
)
end
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录