Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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
 
Loading
Loading
@@ -355,7 +353,7 @@ class User < ActiveRecord::Base
end
 
def accessible_deploy_keys
DeployKey.in_projects(self.master_projects).uniq
DeployKey.in_projects(self.authorized_projects).uniq
end
 
def created_by
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment