Merge branch '2035-arv-mount-tags-folders' into origin-2035-arv-mount-tags-folders
[arvados.git] / apps / workbench / app / models / virtual_machine.rb
1 class VirtualMachine < ArvadosBase
2   attr_accessor :current_user_logins
3   def self.creatable?
4     current_user.andand.is_admin
5   end
6   def attributes_for_display
7     super.append ['current_user_logins', @current_user_logins]
8   end
9   def attribute_editable?(attr)
10     attr != 'current_user_logins' and super
11   end
12   def self.attribute_info
13     merger = ->(k,a,b) { a.merge(b, &merger) }
14     merger [nil,
15             {current_user_logins: {column_heading: "logins", type: 'array'}},
16             super]
17   end
18   def friendly_link_name
19     (hostname && !hostname.empty?) ? hostname : uuid
20   end
21 end