Merge branch 'master' into 6203-collection-perf-api
[arvados.git] / apps / workbench / app / models / group.rb
index 638f6e884abf5fca1df9768bbf5eca56184de8d3..3f5da155c4ca9fc5ea13d0836551a92c3c11d435 100644 (file)
@@ -1,8 +1,21 @@
 class Group < ArvadosBase
-  def self.goes_in_folders?
+  def self.goes_in_projects?
     true
   end
 
+  def self.copies_to_projects?
+    false
+  end
+
+  def self.contents params={}
+    res = arvados_api_client.api self, "/contents", {
+      _method: 'GET'
+    }.merge(params)
+    ret = ArvadosResourceList.new
+    ret.results = arvados_api_client.unpack_api_response(res)
+    ret
+  end
+
   def contents params={}
     res = arvados_api_client.api self.class, "/#{self.uuid}/contents", {
       _method: 'GET'
@@ -13,12 +26,10 @@ class Group < ArvadosBase
   end
 
   def class_for_display
-    group_class == 'folder' ? 'Folder' : super
+    group_class == 'project' ? 'Project' : super
   end
 
-  def editable?
-    respond_to?(:writable_by) and
-      writable_by and
-      writable_by.index(current_user.uuid)
+  def textile_attributes
+    [ 'description' ]
   end
 end