included do
ACCESSIBLE_BY_SQL_QUERY = <<SQL.freeze
repositories.access NOT LIKE 'private%'
OR repositories.id IN (SELECT item_id
FROM permissions
WHERE item_type = 'Repository'
AND subject_type = 'User' AND subject_id = ?)
OR repositories.id IN (SELECT item_id
FROM permissions
INNER JOIN team_users
ON team_users.team_id = permissions.subject_id
AND team_users.user_id = ?
WHERE item_type = 'Repository'
AND subject_type = 'Team')
SQL
if user
else
end
end
# Ready for pulling
end
end
end