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
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
15c0e58a
Commit
15c0e58a
authored
Feb 26, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove unused code related to gitolite
parent
c08f19f2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
42 deletions
+0
-42
app/models/key.rb
app/models/key.rb
+0
-9
app/models/project_team.rb
app/models/project_team.rb
+0
-22
app/models/user.rb
app/models/user.rb
+0
-11
No files found.
app/models/key.rb
View file @
15c0e58a
...
...
@@ -21,7 +21,6 @@ class Key < ActiveRecord::Base
attr_accessible
:key
,
:title
before_validation
:strip_white_space
before_save
:set_identifier
validates
:title
,
presence:
true
,
length:
{
within:
0
..
255
}
validates
:key
,
presence:
true
,
length:
{
within:
0
..
5000
},
format:
{
:with
=>
/ssh-.{3} /
},
uniqueness:
true
...
...
@@ -48,14 +47,6 @@ class Key < ActiveRecord::Base
errors
.
add
(
:key
,
"can't be fingerprinted"
)
if
$?
.
exitstatus
!=
0
end
def
set_identifier
if
is_deploy_key
self
.
identifier
=
"deploy_
#{
Digest
::
MD5
.
hexdigest
(
key
)
}
"
else
self
.
identifier
=
"
#{
user
.
identifier
}
_
#{
Time
.
now
.
to_i
}
"
end
end
def
is_deploy_key
!!
project_id
end
...
...
app/models/project_team.rb
View file @
15c0e58a
...
...
@@ -66,28 +66,6 @@ class ProjectTeam
members
.
masters
.
map
(
&
:user
)
end
def
repository_readers
repository_members
[
UsersProject
::
REPORTER
]
end
def
repository_writers
repository_members
[
UsersProject
::
DEVELOPER
]
end
def
repository_masters
repository_members
[
UsersProject
::
MASTER
]
end
def
repository_members
keys
=
Hash
.
new
{
|
h
,
k
|
h
[
k
]
=
[]
}
UsersProject
.
select
(
"keys.identifier, project_access"
).
joins
(
user: :keys
).
where
(
project_id:
project
.
id
).
each
{
|
row
|
keys
[
row
.
project_access
]
<<
[
row
.
identifier
]
}
keys
[
UsersProject
::
REPORTER
]
+=
project
.
deploy_keys
.
pluck
(
:identifier
)
keys
end
def
import
(
source_project
)
target_project
=
project
...
...
app/models/user.rb
View file @
15c0e58a
...
...
@@ -216,17 +216,6 @@ class User < ActiveRecord::Base
UsersProject
.
where
(
project_id:
authorized_projects
.
map
(
&
:id
),
user_id:
self
.
id
)
end
# Returns a string for use as a Gitolite user identifier
#
# Note that Gitolite 2.x requires the following pattern for users:
#
# ^@?[0-9a-zA-Z][0-9a-zA-Z._\@+-]*$
def
identifier
# Replace non-word chars with underscores, then make sure it starts with
# valid chars
email
.
gsub
(
/\W/
,
'_'
).
gsub
(
/\A([\W\_])+/
,
''
)
end
def
is_admin?
admin
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