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
4e0a0d09
Commit
4e0a0d09
authored
Dec 05, 2016
by
Ahmad Sherif
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Authorize users into imported GitLab project
parent
5fedc463
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
2 deletions
+14
-2
app/models/member.rb
app/models/member.rb
+1
-0
changelogs/unreleased/fix-authorize-users-into-imported-gitlab-project.yml
...ased/fix-authorize-users-into-imported-gitlab-project.yml
+4
-0
spec/lib/gitlab/import_export/members_mapper_spec.rb
spec/lib/gitlab/import_export/members_mapper_spec.rb
+9
-2
No files found.
app/models/member.rb
View file @
4e0a0d09
...
...
@@ -63,6 +63,7 @@ class Member < ActiveRecord::Base
after_create
:send_request
,
if: :request?
,
unless: :importing?
after_create
:create_notification_setting
,
unless:
[
:pending?
,
:importing?
]
after_create
:post_create_hook
,
unless:
[
:pending?
,
:importing?
]
after_create
:refresh_member_authorized_projects
,
if: :importing?
after_update
:post_update_hook
,
unless:
[
:pending?
,
:importing?
]
after_destroy
:post_destroy_hook
,
unless: :pending?
...
...
changelogs/unreleased/fix-authorize-users-into-imported-gitlab-project.yml
0 → 100644
View file @
4e0a0d09
---
title
:
Authorize users into imported GitLab project
merge_request
:
author
:
spec/lib/gitlab/import_export/members_mapper_spec.rb
View file @
4e0a0d09
...
...
@@ -2,9 +2,9 @@ require 'spec_helper'
describe
Gitlab
::
ImportExport
::
MembersMapper
,
services:
true
do
describe
'map members'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
,
authorized_projects_populated:
true
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
name:
'searchable_project'
)
}
let
(
:user2
)
{
create
(
:user
)
}
let
(
:user2
)
{
create
(
:user
,
authorized_projects_populated:
true
)
}
let
(
:exported_user_id
)
{
99
}
let
(
:exported_members
)
do
[{
...
...
@@ -67,5 +67,12 @@ describe Gitlab::ImportExport::MembersMapper, services: true do
expect
(
ProjectMember
.
find_by_invite_email
(
'invite@test.com'
)).
not_to
be_nil
end
it
'authorizes the users to the project'
do
members_mapper
.
map
expect
(
user
.
authorized_project?
(
project
)).
to
be
true
expect
(
user2
.
authorized_project?
(
project
)).
to
be
true
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