BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
18c82265
Unverified
Commit
18c82265
authored
Nov 13, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor project fork service
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
58011d61
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
fork_service.rb
app/services/projects/fork_service.rb
+6
-3
No files found.
app/services/projects/fork_service.rb
View file @
18c82265
...
...
@@ -13,11 +13,14 @@ module Projects
project
=
Project
.
new
(
project_params
)
project
.
name
=
@from_project
.
name
project
.
path
=
@from_project
.
path
project
.
namespace
=
@current_user
.
namespace
project
.
creator
=
@current_user
if
namespace
=
@params
[
:namespace
]
project
.
namespace
=
namespace
else
project
.
namespace
=
@current_user
.
namespace
end
project
.
creator
=
@current_user
unless
@current_user
.
can?
(
:create_projects
,
project
.
namespace
)
project
.
errors
.
add
(
:namespace
,
'insufficient access rights'
)
return
project
...
...
@@ -47,8 +50,8 @@ module Projects
else
project
.
errors
.
add
(
:base
,
"Invalid fork destination"
)
end
project
project
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