move Team_members controller into project (conflicts with team/members controller)

This commit is contained in:
Andrey Kumanyaev 2013-01-21 23:55:55 +04:00 committed by Dmitriy Zaporozhets
parent 497f7ab5ba
commit 1dd0feacc7
11 changed files with 107 additions and 53 deletions

View file

@ -494,6 +494,11 @@ class Project < ActiveRecord::Base
http_url = [Gitlab.config.gitlab.url, "/", path_with_namespace, ".git"].join('')
end
def project_access_human(member)
project_user_relation = self.users_projects.find_by_user_id(member.id)
self.class.access_options.key(project_user_relation.project_access)
end
# Check if current branch name is marked as protected in the system
def protected_branch? branch_name
protected_branches.map(&:name).include?(branch_name)