1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
5 class VirtualMachine < ArvadosModel
8 include CommonApiTemplate
10 has_many(:login_permissions,
11 -> { where("link_class = 'permission' and name = 'can_login'") },
12 foreign_key: :head_uuid,
16 api_accessible :user, extend: :common do |t|
22 def permission_to_create
23 current_user and current_user.is_admin
25 def permission_to_update
26 current_user and current_user.is_admin