2756: store websocket in window to facilitate reuse within page. also, remove element...
[arvados.git] / apps / workbench / app / models / group.rb
index 2a500a58e0964138cd1c2effe727d06a5acba1e9..dde6019e9ca4ed9a5d51978fe933fabee0208727 100644 (file)
@@ -1,2 +1,20 @@
-class Group < OrvosBase
+class Group < ArvadosBase
+  def contents params={}
+    res = $arvados_api_client.api self.class, "/#{self.uuid}/contents", {
+      _method: 'GET'
+    }.merge(params)
+    ret = ArvadosResourceList.new
+    ret.results = $arvados_api_client.unpack_api_response(res)
+    ret
+  end
+
+  def class_for_display
+    group_class == 'folder' ? 'Folder' : super
+  end
+
+  def editable?
+    respond_to?(:writable_by) and
+      writable_by and
+      writable_by.index(current_user.uuid)
+  end
 end