Commit 8f4a0bd1 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

fix filters & seeds

parent 03e51c30
......@@ -8,7 +8,7 @@ class ProjectsController < ApplicationController
before_filter :add_project_abilities
before_filter :authorize_read_project!, :except => [:index, :new, :create]
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
def index
......
class RefsController < ApplicationController
before_filter :project
before_filter :ref
before_filter :define_tree_vars, :only => [:tree, :blob]
layout "project"
# Authorize
before_filter :add_project_abilities
before_filter :authorize_read_project!
before_filter :require_non_empty_project
before_filter :ref
before_filter :define_tree_vars, :only => [:tree, :blob]
layout "project"
def switch
new_path = if params[:destination] == "tree"
tree_project_ref_path(@project, params[:ref])
......
......@@ -180,7 +180,7 @@ class Project < ActiveRecord::Base
end
def repo_name
if path == "gitosis-admin"
if path == "gitosis-admin" && path == "gitolite-admin"
errors.add(:path, " like 'gitosis-admin' is not allowed")
end
end
......
UsersProject.seed(:id, [
{ :id => 1, :project_id => 1, :user_id => 1},
{ :id => 2, :project_id => 1, :user_id => 2},
{ :id => 3, :project_id => 1, :user_id => 3},
{ :id => 4, :project_id => 1, :user_id => 4},
{ :id => 5, :project_id => 1, :user_id => 5},
{ :id => 1, :project_id => 1, :user_id => 1, :read => true, :write => true, :admin => true },
{ :id => 2, :project_id => 1, :user_id => 2, :read => true, :write => false, :admin => false },
{ :id => 3, :project_id => 1, :user_id => 3, :read => true, :write => false, :admin => false },
{ :id => 4, :project_id => 1, :user_id => 4, :read => true, :write => false, :admin => false },
{ :id => 5, :project_id => 1, :user_id => 5, :read => true, :write => false, :admin => false },
{ :id => 6, :project_id => 2, :user_id => 1},
{ :id => 7, :project_id => 2, :user_id => 2},
{ :id => 8, :project_id => 2, :user_id => 3},
{ :id => 9, :project_id => 2, :user_id => 4},
{ :id => 11, :project_id => 2, :user_id => 5},
{ :id => 6, :project_id => 2, :user_id => 1, :read => true, :write => true, :admin => true },
{ :id => 7, :project_id => 2, :user_id => 2, :read => true, :write => false, :admin => false },
{ :id => 8, :project_id => 2, :user_id => 3, :read => true, :write => false, :admin => false },
{ :id => 9, :project_id => 2, :user_id => 4, :read => true, :write => false, :admin => false },
{ :id => 11, :project_id => 2, :user_id => 5, :read => true, :write => false, :admin => false },
{ :id => 12, :project_id => 3, :user_id => 1},
{ :id => 13, :project_id => 3, :user_id => 2},
{ :id => 14, :project_id => 3, :user_id => 3},
{ :id => 15, :project_id => 3, :user_id => 4},
{ :id => 16, :project_id => 3, :user_id => 5}
{ :id => 12, :project_id => 3, :user_id => 1, :read => true, :write => true, :admin => true },
{ :id => 13, :project_id => 3, :user_id => 2, :read => true, :write => false, :admin => false },
{ :id => 14, :project_id => 3, :user_id => 3, :read => true, :write => false, :admin => false },
{ :id => 15, :project_id => 3, :user_id => 4, :read => true, :write => false, :admin => false },
{ :id => 16, :project_id => 3, :user_id => 5, :read => true, :write => false, :admin => false }
])
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment