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
096485ef
Commit
096485ef
authored
Jan 20, 2016
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Creator should be added as a master of the project on creation
This also enable a project creator to add themselves as a master of the project.
parent
481644ca
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
member.rb
app/models/member.rb
+6
-1
create_service.rb
app/services/projects/create_service.rb
+1
-1
No files found.
app/models/member.rb
View file @
096485ef
...
...
@@ -91,7 +91,7 @@ class Member < ActiveRecord::Base
member
.
invite_email
=
user
end
if
can_update_member?
(
current_user
,
member
)
if
can_update_member?
(
current_user
,
member
)
||
project_creator?
(
member
,
access_level
)
member
.
created_by
||=
current_user
member
.
access_level
=
access_level
...
...
@@ -107,6 +107,11 @@ class Member < ActiveRecord::Base
current_user
.
can?
(
:update_group_member
,
member
)
||
current_user
.
can?
(
:update_project_member
,
member
)
end
def
project_creator?
(
member
,
access_level
)
member
.
new_record?
&&
member
.
owner?
&&
access_level
.
to_i
==
ProjectMember
::
MASTER
end
end
def
invite?
...
...
app/services/projects/create_service.rb
View file @
096485ef
...
...
@@ -95,7 +95,7 @@ module Projects
system_hook_service
.
execute_hooks_for
(
@project
,
:create
)
unless
@project
.
group
@project
.
team
<<
[
current_user
,
:master
]
@project
.
team
<<
[
current_user
,
:master
,
current_user
]
end
@project
.
import_start
if
@project
.
import?
...
...
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