[ARVADOS] updated: 82b0423895892677ce49c4b0f731618458195596
git at public.curoverse.com
git at public.curoverse.com
Tue Jun 17 16:56:19 EDT 2014
Summary of changes:
apps/workbench/app/controllers/application_controller.rb | 5 ++++-
apps/workbench/app/models/user.rb | 6 +-----
apps/workbench/app/views/layouts/application.html.erb | 10 +++++-----
.../app/views/pipeline_instances/_show_inputs.html.erb | 2 +-
apps/workbench/app/views/pipeline_instances/show.html.erb | 4 ++--
.../app/views/pipeline_templates/_show_components.html.erb | 2 +-
.../app/views/pipeline_templates/_show_recent.html.erb | 2 +-
apps/workbench/app/views/projects/index.html.erb | 4 ++--
services/api/lib/current_api_client.rb | 2 +-
9 files changed, 18 insertions(+), 19 deletions(-)
via 82b0423895892677ce49c4b0f731618458195596 (commit)
from 2a60d5cd2f235465c94fbd1c20bc0b66d559cc6f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 82b0423895892677ce49c4b0f731618458195596
Author: radhika <radhika at curoverse.com>
Date: Tue Jun 17 16:54:27 2014 -0400
2659: anonymous user is inactive.
diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb
index f3d64c8..e47526c 100644
--- a/apps/workbench/app/controllers/application_controller.rb
+++ b/apps/workbench/app/controllers/application_controller.rb
@@ -357,7 +357,7 @@ class ApplicationController < ActionController::Base
using_anonymous_user_token = false
if !params[:api_token] && !session[:arvados_api_token] &&
!Thread.current[:anonymous_api_token]
- if session && (session['arv-referrer'] == 'logout')
+ if session['arv-referrer'] == 'logout'
# do not use anonymous user token and let logout happen
else
anonymous_user_token = Rails.configuration.anonymous_user_token
@@ -491,6 +491,8 @@ class ApplicationController < ActionController::Base
def check_user_agreements
if current_user && !current_user.is_active
+=begin
+ return render '/'
if not current_user.is_invited
return render 'users/inactive'
end
@@ -512,6 +514,7 @@ class ApplicationController < ActionController::Base
if !current_user.is_active
render 'user_agreements/index'
end
+=end
end
true
end
diff --git a/apps/workbench/app/models/user.rb b/apps/workbench/app/models/user.rb
index 66d8bcf..4a1a74d 100644
--- a/apps/workbench/app/models/user.rb
+++ b/apps/workbench/app/models/user.rb
@@ -50,11 +50,7 @@ class User < ArvadosBase
end
def is_anonymous
- self.uuid.andand.match(/anonymouspublic$/)
- end
-
- def can_act?
- !self.is_anonymous # && self.is_active
+ Thread.current[:arvados_api_token] == Rails.configuration.anonymous_user_token
end
end
diff --git a/apps/workbench/app/views/layouts/application.html.erb b/apps/workbench/app/views/layouts/application.html.erb
index 97b139d..a2acfb5 100644
--- a/apps/workbench/app/views/layouts/application.html.erb
+++ b/apps/workbench/app/views/layouts/application.html.erb
@@ -53,7 +53,7 @@
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/"><%= Rails.configuration.site_name.downcase rescue Rails.application.class.parent_name %>
- <% if current_user && !current_user.can_act? %> . You are viewing public data. <% end %>
+ <% if current_user && !current_user.is_active %> . You are viewing public data. <% end %>
</a>
</div>
@@ -77,7 +77,7 @@
-->
<% if current_user %>
- <% if current_user.can_act? %>
+ <% if current_user.is_active %>
<li class="dropdown notification-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" id="notifications-menu">
<span class="badge badge-alert notification-count"><%= @notification_count %></span>
@@ -105,7 +105,7 @@
<% end %>
<% end %>
- <% if current_user.andand.can_act? %>
+ <% if current_user.andand.is_active %>
<li class="dropdown selection-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<span class="fa fa-lg fa-paperclip"></span>
@@ -120,7 +120,7 @@
</li>
<% end %>
- <% if current_user.andand.can_act? %>
+ <% if current_user.andand.is_active %>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" id="system-menu">
<span class="fa fa-lg fa-gear"></span>
@@ -176,7 +176,7 @@
</a>
<ul class="dropdown-menu" role="menu">
<li role="presentation" class="dropdown-header">
- <% if current_user.can_act? %>
+ <% if current_user.is_active %>
<%= link_to projects_path('project[owner_uuid]' => current_project_uuid), method: 'post', class: 'btn btn-xs btn-default pull-right' do %>
<i class="fa fa-plus"></i> New project
<% end %>
diff --git a/apps/workbench/app/views/pipeline_instances/_show_inputs.html.erb b/apps/workbench/app/views/pipeline_instances/_show_inputs.html.erb
index de11133..3a5c1dc 100644
--- a/apps/workbench/app/views/pipeline_instances/_show_inputs.html.erb
+++ b/apps/workbench/app/views/pipeline_instances/_show_inputs.html.erb
@@ -37,7 +37,7 @@
<p><i>Provide <%= n_inputs > 1 ? 'values' : 'a value' %> for the following <%= n_inputs > 1 ? 'parameters' : 'parameter' %>, then click the "Run" button to start the pipeline.</i></p>
<%= content_for :pi_input_form %>
-<% if current_user.andand.can_act? %>
+<% if current_user.andand.is_active %>
<%= link_to(url_for('pipeline_instance[state]' => 'RunningOnServer'),
class: 'btn btn-primary run-pipeline-button',
method: :patch
diff --git a/apps/workbench/app/views/pipeline_instances/show.html.erb b/apps/workbench/app/views/pipeline_instances/show.html.erb
index 7394267..6427344 100644
--- a/apps/workbench/app/views/pipeline_instances/show.html.erb
+++ b/apps/workbench/app/views/pipeline_instances/show.html.erb
@@ -12,13 +12,13 @@
<% end %>
<% content_for :tab_line_buttons do %>
- <% if current_user.andand.can_act? %>
+ <% if current_user.andand.is_active %>
<%= link_to(copy_pipeline_instance_path('id' => @object.uuid, 'pipeline_instance[state]' => 'New'),
class: 'btn btn-primary',
#data: {toggle: :tooltip, placement: :top}, title: 'copy and modify',
method: :post,
) do %>
- <% if current_user.andand.can_act? %>
+ <% if current_user.andand.is_active %>
Clone and edit <i class="fa fa-fw fa-copy"></i>
<% end %>
<% end %>
diff --git a/apps/workbench/app/views/pipeline_templates/_show_components.html.erb b/apps/workbench/app/views/pipeline_templates/_show_components.html.erb
index b606533..6d94b65 100644
--- a/apps/workbench/app/views/pipeline_templates/_show_components.html.erb
+++ b/apps/workbench/app/views/pipeline_templates/_show_components.html.erb
@@ -1,7 +1,7 @@
<% content_for :tab_line_buttons do %>
<%= form_tag '/pipeline_instances' do |f| %>
<%= hidden_field :pipeline_instance, :pipeline_template_uuid, :value => @object.uuid %>
- <% if current_user.andand.can_act? %>
+ <% if current_user.andand.is_active %>
<%= button_tag "Run this pipeline", {class: 'btn btn-primary pull-right', id: "run-pipeline-button"} %>
<% end %>
<% end %>
diff --git a/apps/workbench/app/views/pipeline_templates/_show_recent.html.erb b/apps/workbench/app/views/pipeline_templates/_show_recent.html.erb
index e91800d..a391c6f 100644
--- a/apps/workbench/app/views/pipeline_templates/_show_recent.html.erb
+++ b/apps/workbench/app/views/pipeline_templates/_show_recent.html.erb
@@ -29,7 +29,7 @@
<td>
<%= form_tag '/pipeline_instances' do |f| %>
<%= hidden_field :pipeline_instance, :pipeline_template_uuid, :value => ob.uuid %>
- <% if current_user.andand.can_act? %>
+ <% if current_user.andand.is_active %>
<%= button_tag nil, {class: "btn btn-default btn-xs", title: "Run #{ob.name}"} do %>
Run <i class="fa fa-fw fa-play"></i>
<% end %>
diff --git a/apps/workbench/app/views/projects/index.html.erb b/apps/workbench/app/views/projects/index.html.erb
index 033317f..85141aa 100644
--- a/apps/workbench/app/views/projects/index.html.erb
+++ b/apps/workbench/app/views/projects/index.html.erb
@@ -19,7 +19,7 @@
This site runs Arvados, the open source biomedical analysis platform. <a href="https://arvados.org" target="_blank">Learn more…</a>
</p>
<p>
- <% if current_user.andand.can_act? %>
+ <% if current_user.andand.is_active %>
<b>To get started,</b> create a project using the "Add new project" button below.
<% end %>
</p>
@@ -27,7 +27,7 @@
</div>
<% end %>
- <% if current_user.andand.can_act? %>
+ <% if current_user.andand.is_active %>
<div class="panel panel-default">
<div class="panel-heading">
<div class="pull-right">
diff --git a/services/api/lib/current_api_client.rb b/services/api/lib/current_api_client.rb
index fbfd003..c558150 100644
--- a/services/api/lib/current_api_client.rb
+++ b/services/api/lib/current_api_client.rb
@@ -133,7 +133,7 @@ module CurrentApiClient
$anonymous_user = User.where('uuid=?', anonymous_user_uuid).first
if !$anonymous_user
$anonymous_user = User.new(uuid: anonymous_user_uuid,
- is_active: true,
+ is_active: false,
is_admin: false,
email: 'anonymouspublic',
first_name: 'anonymouspublic',
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list