+ newc.name = newc.name || "Collection created at #{Time.now.localtime}"
+
+ # set owner_uuid to current project, provided it is writable
+ current_project_writable = false
+ action_data = JSON.parse(params['action_data']) if params['action_data']
+ if action_data && action_data['current_project_uuid']
+ current_project = Group.find(action_data['current_project_uuid']) rescue nil
+ if (current_project && current_project.writable_by.andand.include?(current_user.uuid))
+ newc.owner_uuid = action_data['current_project_uuid']
+ current_project_writable = true
+ end
+ end
+