diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 75f562b8b..304ca6901 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -40,12 +40,12 @@ class RepositoriesController < ApplicationController # before_filter :connect_gitlab, :only => [:quality_analysis, :commit_diff] before_filter :find_changeset, :only => [:revision, :add_related_issue, :remove_related_issue] - before_filter :authorize , :except => [:newrepo,:newcreate,:fork, :to_gitlab, :forked, :commit_diff, :project_archive, :quality_analysis] + before_filter :authorize , :except => [:newrepo,:newcreate,:fork, :to_gitlab, :forked, :project_archive, :quality_analysis] # 版本库新增权限 - before_filter :show_rep, :only => [:show] + # before_filter :show_rep, :only => [:show, :stats, :revisions, :revision, :diff, :commit_diff ] accept_rss_auth :revisions # hidden repositories filter // 隐藏代码过滤器 - before_filter :check_hidden_repo, :only => [:stats, :revisions, :revision, :diff ] + # before_filter :check_hidden_repo, :only => [:stats, :revisions, :revision, :diff ] helper :repositories include RepositoriesHelper helper :project_score @@ -689,10 +689,7 @@ update end def show_rep - if !User.current.member_of?(@project) && @project.hidden_repo - render_403 - return - end + visible_repository?(@project) end def find_repository @@ -948,15 +945,4 @@ update graph.burn end - - def check_hidden_repo - project = Project.find(params[:id]) - if !User.current.member_of?(project) - if project.hidden_repo - #render_403 - end - end - rescue ActiveRecord::RecordNotFound - render_404 - end end