Skip to content

Commit f08d924

Browse files
committed
add missing function
1 parent 5e416d8 commit f08d924

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

app/controllers/keys_controller.rb

+8-5
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,7 @@ def all
9595
else
9696
@keys = @keys = Vault::Key.all
9797
end
98-
99-
if @keys.present? && params[:project_id].present?
100-
@keys = @keys.where(project_id: params[:project_id])
101-
end
102-
98+
10399
@keys = @keys.order(sort_clause) unless @keys.nil?
104100
@keys = @keys.select { |key| key.whitelisted?(User,key.project) } unless @keys.nil?
105101
@keys = [] if @keys.nil? #hack for decryption
@@ -243,4 +239,11 @@ def save_file
243239
params['vault_key']['file'] = name
244240
end
245241

242+
def projects_for_jump_box(user=User.current)
243+
if user.logged?
244+
user.projects.active.select(:id, :name, :identifier, :lft, :rgt).to_a
245+
else
246+
[]
247+
end
248+
end
246249
end

0 commit comments

Comments
 (0)