2798: Merged branch with code to read environment variables with branch working on...
[arvados.git] / services / api / app / models / virtual_machine.rb
1 class VirtualMachine < ArvadosModel
2   include AssignUuid
3   include KindAndEtag
4   include CommonApiTemplate
5
6   has_many :login_permissions, :foreign_key => :head_uuid, :class_name => 'Link', :primary_key => :uuid, :conditions => "link_class = 'permission' and name = 'can_login'"
7
8   api_accessible :user, extend: :common do |t|
9     t.add :hostname
10   end
11
12   protected
13
14   def permission_to_create
15     current_user and current_user.is_admin
16   end
17   def permission_to_update
18     current_user and current_user.is_admin
19   end
20 end