[ARVADOS] updated: 87e9c0e26ff55582a993a8e11902e8657647f59a
git at public.curoverse.com
git at public.curoverse.com
Fri Jul 3 12:08:02 EDT 2015
Summary of changes:
apps/workbench/app/controllers/projects_controller.rb | 2 +-
apps/workbench/config/application.default.yml | 3 +++
apps/workbench/test/controllers/projects_controller_test.rb | 7 +++++++
3 files changed, 11 insertions(+), 1 deletion(-)
via 87e9c0e26ff55582a993a8e11902e8657647f59a (commit)
from 76e74a7feb2142ff48a1189957626cc8f6deb360 (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 87e9c0e26ff55582a993a8e11902e8657647f59a
Author: Manoj <jonam33 at gmail.com>
Date: Fri Jul 3 12:06:22 2015 -0400
6466:Added config parameter to disable public projects page and added a test to projects controller.
diff --git a/apps/workbench/app/controllers/projects_controller.rb b/apps/workbench/app/controllers/projects_controller.rb
index 4087b59..44c8518 100644
--- a/apps/workbench/app/controllers/projects_controller.rb
+++ b/apps/workbench/app/controllers/projects_controller.rb
@@ -319,7 +319,7 @@ class ProjectsController < ApplicationController
end
def public # Yes 'public' is the name of the action for public projects
- return render_not_found if not Rails.configuration.anonymous_user_token
+ return render_not_found if not Rails.configuration.anonymous_user_token or not Rails.configuration.enable_public_projects_page
@objects = using_specific_api_token Rails.configuration.anonymous_user_token do
Group.where(group_class: 'project').order("updated_at DESC")
end
diff --git a/apps/workbench/config/application.default.yml b/apps/workbench/config/application.default.yml
index cae7b19..4ade8b4 100644
--- a/apps/workbench/config/application.default.yml
+++ b/apps/workbench/config/application.default.yml
@@ -209,5 +209,8 @@ common:
# in the directory where your API server is running.
anonymous_user_token: false
+ # when anonymous_user_token is configured, show public projects page
+ enable_public_projects_page: true
+
# Ask Arvados API server to compress its response payloads.
api_response_compression: true
diff --git a/apps/workbench/test/controllers/projects_controller_test.rb b/apps/workbench/test/controllers/projects_controller_test.rb
index d7fb8f2..41ed727 100644
--- a/apps/workbench/test/controllers/projects_controller_test.rb
+++ b/apps/workbench/test/controllers/projects_controller_test.rb
@@ -275,6 +275,13 @@ class ProjectsControllerTest < ActionController::TestCase
assert_response 404
end
+ test "visit public projects page when anon config is enabled but public projects page is disabled and expect 404" do
+ Rails.configuration.anonymous_user_token = api_fixture('api_client_authorizations')['anonymous']['api_token']
+ Rails.configuration.enable_public_projects_page = false
+ get :public, {}, session_for(:active)
+ assert_response 404
+ end
+
test "visit public projects page when anon config is not enabled as anonymous and expect login page" do
get :public
assert_response :redirect
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list