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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kazuhiko Shiozaki
gitlab-ce
Commits
8f4a0bd1
Commit
8f4a0bd1
authored
Dec 04, 2011
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix filters & seeds
parent
03e51c30
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
20 deletions
+21
-20
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+1
-1
app/controllers/refs_controller.rb
app/controllers/refs_controller.rb
+4
-3
app/models/project.rb
app/models/project.rb
+1
-1
db/fixtures/development/004_teams.rb
db/fixtures/development/004_teams.rb
+15
-15
No files found.
app/controllers/projects_controller.rb
View file @
8f4a0bd1
...
@@ -8,7 +8,7 @@ class ProjectsController < ApplicationController
...
@@ -8,7 +8,7 @@ class ProjectsController < ApplicationController
before_filter
:add_project_abilities
before_filter
:add_project_abilities
before_filter
:authorize_read_project!
,
:except
=>
[
:index
,
:new
,
:create
]
before_filter
:authorize_read_project!
,
:except
=>
[
:index
,
:new
,
:create
]
before_filter
:authorize_admin_project!
,
:only
=>
[
:edit
,
:update
,
:destroy
]
before_filter
:authorize_admin_project!
,
:only
=>
[
:edit
,
:update
,
:destroy
]
before_filter
:require_non_empty_project
,
:only
=>
[
:blob
,
:tree
]
before_filter
:require_non_empty_project
,
:only
=>
[
:blob
,
:tree
,
:graph
]
before_filter
:load_refs
,
:only
=>
:tree
# load @branch, @tag & @ref
before_filter
:load_refs
,
:only
=>
:tree
# load @branch, @tag & @ref
def
index
def
index
...
...
app/controllers/refs_controller.rb
View file @
8f4a0bd1
class
RefsController
<
ApplicationController
class
RefsController
<
ApplicationController
before_filter
:project
before_filter
:project
before_filter
:ref
before_filter
:define_tree_vars
,
:only
=>
[
:tree
,
:blob
]
layout
"project"
# Authorize
# Authorize
before_filter
:add_project_abilities
before_filter
:add_project_abilities
before_filter
:authorize_read_project!
before_filter
:authorize_read_project!
before_filter
:require_non_empty_project
before_filter
:require_non_empty_project
before_filter
:ref
before_filter
:define_tree_vars
,
:only
=>
[
:tree
,
:blob
]
layout
"project"
def
switch
def
switch
new_path
=
if
params
[
:destination
]
==
"tree"
new_path
=
if
params
[
:destination
]
==
"tree"
tree_project_ref_path
(
@project
,
params
[
:ref
])
tree_project_ref_path
(
@project
,
params
[
:ref
])
...
...
app/models/project.rb
View file @
8f4a0bd1
...
@@ -180,7 +180,7 @@ class Project < ActiveRecord::Base
...
@@ -180,7 +180,7 @@ class Project < ActiveRecord::Base
end
end
def
repo_name
def
repo_name
if
path
==
"gitosis-admin"
if
path
==
"gitosis-admin"
&&
path
==
"gitolite-admin"
errors
.
add
(
:path
,
" like 'gitosis-admin' is not allowed"
)
errors
.
add
(
:path
,
" like 'gitosis-admin' is not allowed"
)
end
end
end
end
...
...
db/fixtures/development/004_teams.rb
View file @
8f4a0bd1
UsersProject
.
seed
(
:id
,
[
UsersProject
.
seed
(
:id
,
[
{
:id
=>
1
,
:project_id
=>
1
,
:user_id
=>
1
},
{
:id
=>
1
,
:project_id
=>
1
,
:user_id
=>
1
,
:read
=>
true
,
:write
=>
true
,
:admin
=>
true
},
{
:id
=>
2
,
:project_id
=>
1
,
:user_id
=>
2
},
{
:id
=>
2
,
:project_id
=>
1
,
:user_id
=>
2
,
:read
=>
true
,
:write
=>
false
,
:admin
=>
false
},
{
:id
=>
3
,
:project_id
=>
1
,
:user_id
=>
3
},
{
:id
=>
3
,
:project_id
=>
1
,
:user_id
=>
3
,
:read
=>
true
,
:write
=>
false
,
:admin
=>
false
},
{
:id
=>
4
,
:project_id
=>
1
,
:user_id
=>
4
},
{
:id
=>
4
,
:project_id
=>
1
,
:user_id
=>
4
,
:read
=>
true
,
:write
=>
false
,
:admin
=>
false
},
{
:id
=>
5
,
:project_id
=>
1
,
:user_id
=>
5
},
{
:id
=>
5
,
:project_id
=>
1
,
:user_id
=>
5
,
:read
=>
true
,
:write
=>
false
,
:admin
=>
false
},
{
:id
=>
6
,
:project_id
=>
2
,
:user_id
=>
1
},
{
:id
=>
6
,
:project_id
=>
2
,
:user_id
=>
1
,
:read
=>
true
,
:write
=>
true
,
:admin
=>
true
},
{
:id
=>
7
,
:project_id
=>
2
,
:user_id
=>
2
},
{
:id
=>
7
,
:project_id
=>
2
,
:user_id
=>
2
,
:read
=>
true
,
:write
=>
false
,
:admin
=>
false
},
{
:id
=>
8
,
:project_id
=>
2
,
:user_id
=>
3
},
{
:id
=>
8
,
:project_id
=>
2
,
:user_id
=>
3
,
:read
=>
true
,
:write
=>
false
,
:admin
=>
false
},
{
:id
=>
9
,
:project_id
=>
2
,
:user_id
=>
4
},
{
:id
=>
9
,
:project_id
=>
2
,
:user_id
=>
4
,
:read
=>
true
,
:write
=>
false
,
:admin
=>
false
},
{
:id
=>
11
,
:project_id
=>
2
,
:user_id
=>
5
},
{
:id
=>
11
,
:project_id
=>
2
,
:user_id
=>
5
,
:read
=>
true
,
:write
=>
false
,
:admin
=>
false
},
{
:id
=>
12
,
:project_id
=>
3
,
:user_id
=>
1
},
{
:id
=>
12
,
:project_id
=>
3
,
:user_id
=>
1
,
:read
=>
true
,
:write
=>
true
,
:admin
=>
true
},
{
:id
=>
13
,
:project_id
=>
3
,
:user_id
=>
2
},
{
:id
=>
13
,
:project_id
=>
3
,
:user_id
=>
2
,
:read
=>
true
,
:write
=>
false
,
:admin
=>
false
},
{
:id
=>
14
,
:project_id
=>
3
,
:user_id
=>
3
},
{
:id
=>
14
,
:project_id
=>
3
,
:user_id
=>
3
,
:read
=>
true
,
:write
=>
false
,
:admin
=>
false
},
{
:id
=>
15
,
:project_id
=>
3
,
:user_id
=>
4
},
{
:id
=>
15
,
:project_id
=>
3
,
:user_id
=>
4
,
:read
=>
true
,
:write
=>
false
,
:admin
=>
false
},
{
:id
=>
16
,
:project_id
=>
3
,
:user_id
=>
5
}
{
:id
=>
16
,
:project_id
=>
3
,
:user_id
=>
5
,
:read
=>
true
,
:write
=>
false
,
:admin
=>
false
}
])
])
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