app/controllers/projects_controller.rb
# get a list of all workspaces in a project
get a list of all workspaces in a project
get a list of all workspaces in a project
def workspaces
    client = user_fire_cloud_client(current_user, @project.namespace)
    @workspaces = client.workspaces(@project.namespace)
    @computes = {}
    Parallel.map(@workspaces, in_threads: 3) do |workspace|
      workspace_name = workspace['workspace']['name']
      acl = client.get_workspace_acl(@project.namespace, workspace_name)
      @computes[workspace_name] = []
      acl['acl'].each do |user, permission|
        @computes[workspace_name] << {"#{user}" => {can_compute: permission['canCompute'], access_level: permission['accessLevel']} }
      end
    end
  end
def workspaces client = user_fire_cloud_client ( current_user , @project . namespace ) @workspaces = client . workspaces ( @project . namespace ) @computes = { } Parallel . map ( @workspaces , in_threads : 3 ) do | workspace | workspace_name = workspace [ 'workspace' ] [ 'name' ] acl = client . get_workspace_acl ( @project . namespace , workspace_name ) @computes [ workspace_name ] = [ ] acl [ 'acl' ] . each do | user , permission | @computes [ workspace_name ] << { "#{user}" => { can_compute : permission [ 'canCompute' ] , access_level : permission [ 'accessLevel' ] } } end end end
get a list of all workspaces in a project
get a list of all workspaces in a project