- if (item.class == Link and
- item.link_class == 'name' and
- item.tail_uuid == @object.uuid)
- # Given uuid is a name link, linking an object to this
- # project. First follow the link to find the item we're removing,
- # then delete the link.
- links << item
- item = ArvadosBase.find item.head_uuid
- else
- # Given uuid is an object. Delete all names.
- links += Link.where(tail_uuid: @object.uuid,
- head_uuid: item.uuid,
- link_class: 'name')
- end
- links.each do |link|
- @removed_uuids << link.uuid
- link.destroy
- end
-
- if item.class == Collection
- # Use delete API on collections
+ if item.class == Collection or item.class == Group
+ # Use delete API on collections and projects/groups