Commit d0efe2c0 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Since masters_projects does not cover most of cases now we use...

Since masters_projects does not cover most of cases now we use authorized_projects for DeployKey read access
parent b1dbabde
......@@ -91,8 +91,6 @@ class User < ActiveRecord::Base
has_many :groups_projects, through: :groups, source: :projects
has_many :personal_projects, through: :namespace, source: :projects
has_many :projects, through: :users_projects
has_many :master_projects, through: :users_projects, source: :project,
conditions: { users_projects: { project_access: UsersProject::MASTER } }
has_many :own_projects, foreign_key: :creator_id, class_name: 'Project'
has_many :owned_projects, through: :namespaces, source: :projects
......@@ -355,7 +353,7 @@ def ldap_user?
end
def accessible_deploy_keys
DeployKey.in_projects(self.master_projects).uniq
DeployKey.in_projects(self.authorized_projects).uniq
end
def created_by
......
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