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
# 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
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