版本库权限简化,及超级管理员可以查看项目版本库

This commit is contained in:
huang 2016-11-01 14:09:56 +08:00
parent b93946cd07
commit 85db4d7fd1
1 changed files with 4 additions and 18 deletions

View File

@ -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