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
30d91511
Commit
30d91511
authored
May 23, 2019
by
James Lopez
Committed by
Jan Provaznik
May 23, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue importing members with owner access
parent
bd1ef521
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
1 deletion
+18
-1
changelogs/unreleased/fix-import-member-access.yml
changelogs/unreleased/fix-import-member-access.yml
+5
-0
doc/user/project/settings/import_export.md
doc/user/project/settings/import_export.md
+1
-0
lib/gitlab/import_export/members_mapper.rb
lib/gitlab/import_export/members_mapper.rb
+5
-1
spec/lib/gitlab/import_export/members_mapper_spec.rb
spec/lib/gitlab/import_export/members_mapper_spec.rb
+7
-0
No files found.
changelogs/unreleased/fix-import-member-access.yml
0 → 100644
View file @
30d91511
---
title
:
Fix issue importing members with owner access
merge_request
:
28636
author
:
type
:
fixed
doc/user/project/settings/import_export.md
View file @
30d91511
...
...
@@ -23,6 +23,7 @@
> in the import side is required to map the users, based on email or username.
> Otherwise, a supplementary comment is left to mention the original author and
> the MRs, notes or issues will be owned by the importer.
> - Project members with owner access will get imported as maintainers.
> - Control project Import/Export with the [API](../../../api/project_import_export.md).
> - If an imported project contains merge requests originated from forks,
> then new branches associated with such merge requests will be created
...
...
lib/gitlab/import_export/members_mapper.rb
View file @
30d91511
...
...
@@ -59,7 +59,11 @@ module Gitlab
end
def
member_hash
(
member
)
parsed_hash
(
member
).
merge
(
'source_id'
=>
@project
.
id
,
'importing'
=>
true
)
parsed_hash
(
member
).
merge
(
'source_id'
=>
@project
.
id
,
'importing'
=>
true
,
'access_level'
=>
[
member
[
'access_level'
],
ProjectMember
::
MAINTAINER
].
min
)
end
def
parsed_hash
(
member
)
...
...
spec/lib/gitlab/import_export/members_mapper_spec.rb
View file @
30d91511
...
...
@@ -73,6 +73,13 @@ describe Gitlab::ImportExport::MembersMapper do
expect
(
user2
.
authorized_project?
(
project
)).
to
be
true
end
it
'maps an owner as a maintainer'
do
exported_members
.
first
[
'access_level'
]
=
ProjectMember
::
OWNER
expect
(
members_mapper
.
map
[
exported_user_id
]).
to
eq
(
user2
.
id
)
expect
(
ProjectMember
.
find_by_user_id
(
user2
.
id
).
access_level
).
to
eq
(
ProjectMember
::
MAINTAINER
)
end
context
'user is not an admin'
do
let
(
:user
)
{
create
(
:user
)
}
...
...
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