15531: Test federation migrate script WIP
[arvados.git] / services / api / app / models / virtual_machine.rb
index 43f3c44839dfa8b225b03a54e0e717523909a7ca..0b3557eef6c68a802c977436dc979c3c138fedfa 100644 (file)
@@ -1,9 +1,19 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
 class VirtualMachine < ArvadosModel
-  include AssignUuid
+  include HasUuid
   include KindAndEtag
   include CommonApiTemplate
 
-  api_accessible :superuser, :extend => :common do |t|
+  has_many(:login_permissions,
+           -> { where("link_class = 'permission' and name = 'can_login'") },
+           foreign_key: :head_uuid,
+           class_name: 'Link',
+           primary_key: :uuid)
+
+  api_accessible :user, extend: :common do |t|
     t.add :hostname
   end