[ARVADOS] updated: c14e0f75ffd65fdb01743170d3ffb6ecc14deccf

git at public.curoverse.com git at public.curoverse.com
Sat Jun 14 10:04:36 EDT 2014


Summary of changes:
 .../app/assets/javascripts/application.js          |    5 +
 apps/workbench/app/assets/javascripts/editable.js  |   14 +-
 .../workbench/app/assets/javascripts/filterable.js |   42 +
 apps/workbench/app/assets/javascripts/folders.js   |   12 -
 .../app/assets/javascripts/infinite_scroll.js      |   53 +
 apps/workbench/app/assets/javascripts/list.js      | 1474 ++++++++++++++++++++
 .../workbench/app/assets/javascripts/log_viewer.js |   56 +
 .../app/assets/javascripts/pipeline_instances.js   |   41 +-
 .../app/assets/javascripts/select_modal.js         |   33 +-
 apps/workbench/app/assets/javascripts/selection.js |   53 +-
 .../app/assets/stylesheets/application.css.scss    |   77 +-
 .../app/assets/stylesheets/folders.css.scss        |   13 -
 .../workbench/app/assets/stylesheets/jobs.css.scss |   13 +-
 .../app/assets/stylesheets/log_viewer.scss         |   34 +
 .../app/assets/stylesheets/projects.css.scss       |   12 +
 .../app/assets/stylesheets/select_modal.css.scss   |   12 +
 .../app/controllers/actions_controller.rb          |   57 +-
 .../app/controllers/application_controller.rb      |  274 +++-
 .../app/controllers/collections_controller.rb      |   24 +-
 .../app/controllers/folders_controller.rb          |  118 --
 .../workbench/app/controllers/groups_controller.rb |    9 +-
 apps/workbench/app/controllers/jobs_controller.rb  |    2 +-
 .../controllers/pipeline_instances_controller.rb   |   56 +-
 .../controllers/pipeline_templates_controller.rb   |    3 +-
 .../app/controllers/projects_controller.rb         |  134 ++
 apps/workbench/app/controllers/users_controller.rb |    1 -
 apps/workbench/app/helpers/application_helper.rb   |  138 +-
 apps/workbench/app/helpers/folders_helper.rb       |    2 -
 .../app/helpers/pipeline_instances_helper.rb       |    5 +
 apps/workbench/app/helpers/projects_helper.rb      |    2 +
 apps/workbench/app/models/arvados_base.rb          |   40 +-
 apps/workbench/app/models/collection.rb            |    9 +-
 apps/workbench/app/models/group.rb                 |    4 +-
 apps/workbench/app/models/human.rb                 |    2 +-
 apps/workbench/app/models/job.rb                   |   21 +-
 apps/workbench/app/models/link.rb                  |    4 +
 apps/workbench/app/models/pipeline_instance.rb     |   10 +-
 apps/workbench/app/models/pipeline_template.rb     |    2 +-
 apps/workbench/app/models/specimen.rb              |    2 +-
 apps/workbench/app/models/trait.rb                 |    2 +-
 apps/workbench/app/models/user.rb                  |    8 +
 .../views/application/_arvados_attr_value.html.erb |    2 +-
 .../app/views/application/_choose.html.erb         |   31 +
 .../views/{folders => application}/_choose.js.erb  |    2 +-
 .../app/views/application/_content.html.erb        |   25 +-
 .../app/views/application/_content_layout.html.erb |    5 +-
 .../application/_delete_object_button.html.erb     |    2 +-
 .../views/application/_selection_checkbox.html.erb |    2 +-
 .../app/views/application/_show_advanced.html.erb  |   23 +
 .../_show_advanced_api_response.html.erb           |    3 +
 .../_show_advanced_cli_example.html.erb            |    8 +
 .../_show_advanced_curl_example.html.erb           |    9 +
 .../application/_show_advanced_metadata.html.erb   |   56 +
 .../_show_advanced_python_example.html.erb         |    5 +
 .../app/views/application/_show_json.html.erb      |    3 -
 .../app/views/application/_show_metadata.html.erb  |   70 -
 .../views/application/_show_object_button.html.erb |   16 +-
 .../_show_object_description_cell.html.erb         |    2 +
 .../app/views/application/_show_recent.html.erb    |    4 +-
 .../app/views/application/_svg_div.html.erb        |    4 +-
 .../workbench/app/views/application/index.html.erb |   16 +-
 apps/workbench/app/views/application/show.html.erb |    3 +-
 .../workbench/app/views/collections/_choose.js.erb |    1 +
 .../app/views/collections/_choose_rows.html.erb    |   17 +
 .../app/views/collections/_index_tbody.html.erb    |    4 +-
 .../app/views/collections/_show_files.html.erb     |   12 +-
 .../_show_object_description_cell.html.erb         |   14 +
 .../app/views/collections/_show_recent.html.erb    |    4 +-
 apps/workbench/app/views/collections/show.html.erb |   45 +-
 .../app/views/folders/_show_folders.html.erb       |   29 -
 apps/workbench/app/views/folders/show.html.erb     |  214 ---
 .../app/views/jobs/_show_details.html.erb          |    1 +
 apps/workbench/app/views/jobs/_show_log.html.erb   |  124 ++
 .../jobs/_show_object_description_cell.html.erb    |   15 +
 .../app/views/layouts/application.html.erb         |  260 ++--
 .../pipeline_instances/_component_labels.html.erb  |    5 +
 .../pipeline_instances/_show_compare.html.erb      |    5 +-
 .../pipeline_instances/_show_components.html.erb   |  191 +--
 .../views/pipeline_instances/_show_inputs.html.erb |   19 +-
 .../_show_object_description_cell.html.erb         |    4 +
 .../views/pipeline_instances/_show_recent.html.erb |   19 -
 .../app/views/pipeline_instances/compare.html.erb  |   14 +
 .../app/views/pipeline_instances/show.html.erb     |   58 +-
 .../app/views/pipeline_templates/_choose.js.erb    |    1 +
 .../views/pipeline_templates/_choose_rows.html.erb |   11 +
 .../pipeline_templates/_show_components.html.erb   |    2 +
 .../views/pipeline_templates/_show_recent.html.erb |    2 +
 .../views/{folders => projects}/_choose.html.erb   |   22 +-
 apps/workbench/app/views/projects/_choose.js.erb   |    1 +
 .../projects/_index_jobs_and_pipelines.html.erb    |   26 +
 .../app/views/projects/_index_projects.html.erb    |   31 +
 .../app/views/projects/_show_contents.html.erb     |  122 ++
 .../views/projects/_show_contents_rows.html.erb    |   30 +
 .../app/views/projects/_show_featured.html.erb     |   18 +
 .../app/views/projects/_show_permissions.html.erb  |   44 +
 apps/workbench/app/views/projects/index.html.erb   |   84 ++
 .../remove_items.js.erb}                           |    0
 apps/workbench/app/views/users/_home.html.erb      |    2 +-
 apps/workbench/app/views/users/inactive.html.erb   |   22 +
 apps/workbench/app/views/users/welcome.html.erb    |   45 +-
 apps/workbench/config/routes.rb                    |   11 +-
 .../test/functional/collections_controller_test.rb |   20 +-
 .../test/functional/folders_controller_test.rb     |    7 -
 .../test/functional/projects_controller_test.rb    |   12 +
 .../test/functional/users_controller_test.rb       |    3 +-
 .../workbench/test/integration/collections_test.rb |    7 +-
 apps/workbench/test/integration/folders_test.rb    |   83 --
 apps/workbench/test/integration/logins_test.rb     |    5 +-
 .../test/integration/pipeline_instances_test.rb    |  115 +-
 apps/workbench/test/integration/projects_test.rb   |   87 ++
 apps/workbench/test/integration/smoke_test.rb      |    4 +-
 apps/workbench/test/integration/users_test.rb      |   47 +-
 .../test/integration/virtual_machines_test.rb      |    5 +-
 .../test/unit/arvados_resource_list_test.rb        |   12 +-
 apps/workbench/test/unit/group_test.rb             |   12 +-
 .../test/unit/helpers/folders_helper_test.rb       |    4 -
 ...oups_helper_test.rb => projects_helper_test.rb} |    0
 services/api/app/models/log.rb                     |    1 +
 ...0607150616_rename_folder_to_project.rb_deferred |    9 +
 services/api/lib/current_api_client.rb             |    5 +-
 services/api/test/fixtures/groups.yml              |   21 +-
 services/api/test/fixtures/links.yml               |   59 +-
 services/api/test/fixtures/pipeline_instances.yml  |   16 +
 services/api/test/fixtures/specimens.yml           |    8 +-
 .../api/test/functional/arvados/v1/filters_test.rb |    4 +-
 .../arvados/v1/groups_controller_test.rb           |   42 +-
 .../functional/arvados/v1/links_controller_test.rb |    6 +-
 .../functional/arvados/v1/users_controller_test.rb |    2 +-
 services/api/test/unit/group_test.rb               |    2 +-
 services/api/test/unit/link_test.rb                |   10 +-
 services/api/test/unit/owner_test.rb               |    2 +-
 services/api/test/unit/user_test.rb                |    3 +-
 services/fuse/tests/test_mount.py                  |    8 +-
 133 files changed, 4113 insertions(+), 1201 deletions(-)
 create mode 100644 apps/workbench/app/assets/javascripts/filterable.js
 delete mode 100644 apps/workbench/app/assets/javascripts/folders.js
 create mode 100644 apps/workbench/app/assets/javascripts/infinite_scroll.js
 create mode 100644 apps/workbench/app/assets/javascripts/list.js
 create mode 100644 apps/workbench/app/assets/javascripts/log_viewer.js
 delete mode 100644 apps/workbench/app/assets/stylesheets/folders.css.scss
 create mode 100644 apps/workbench/app/assets/stylesheets/log_viewer.scss
 create mode 100644 apps/workbench/app/assets/stylesheets/projects.css.scss
 delete mode 100644 apps/workbench/app/controllers/folders_controller.rb
 create mode 100644 apps/workbench/app/controllers/projects_controller.rb
 delete mode 100644 apps/workbench/app/helpers/folders_helper.rb
 create mode 100644 apps/workbench/app/helpers/projects_helper.rb
 create mode 100644 apps/workbench/app/views/application/_choose.html.erb
 rename apps/workbench/app/views/{folders => application}/_choose.js.erb (88%)
 create mode 100644 apps/workbench/app/views/application/_show_advanced.html.erb
 create mode 100644 apps/workbench/app/views/application/_show_advanced_api_response.html.erb
 create mode 100644 apps/workbench/app/views/application/_show_advanced_cli_example.html.erb
 create mode 100644 apps/workbench/app/views/application/_show_advanced_curl_example.html.erb
 create mode 100644 apps/workbench/app/views/application/_show_advanced_metadata.html.erb
 create mode 100644 apps/workbench/app/views/application/_show_advanced_python_example.html.erb
 delete mode 100644 apps/workbench/app/views/application/_show_json.html.erb
 delete mode 100644 apps/workbench/app/views/application/_show_metadata.html.erb
 create mode 100644 apps/workbench/app/views/application/_show_object_description_cell.html.erb
 create mode 120000 apps/workbench/app/views/collections/_choose.js.erb
 create mode 100644 apps/workbench/app/views/collections/_choose_rows.html.erb
 create mode 100644 apps/workbench/app/views/collections/_show_object_description_cell.html.erb
 delete mode 100644 apps/workbench/app/views/folders/_show_folders.html.erb
 delete mode 100644 apps/workbench/app/views/folders/show.html.erb
 create mode 100644 apps/workbench/app/views/jobs/_show_details.html.erb
 create mode 100644 apps/workbench/app/views/jobs/_show_log.html.erb
 create mode 100644 apps/workbench/app/views/jobs/_show_object_description_cell.html.erb
 create mode 100644 apps/workbench/app/views/pipeline_instances/_component_labels.html.erb
 create mode 100644 apps/workbench/app/views/pipeline_instances/_show_object_description_cell.html.erb
 mode change 120000 => 100644 apps/workbench/app/views/pipeline_instances/show.html.erb
 create mode 120000 apps/workbench/app/views/pipeline_templates/_choose.js.erb
 create mode 100644 apps/workbench/app/views/pipeline_templates/_choose_rows.html.erb
 rename apps/workbench/app/views/{folders => projects}/_choose.html.erb (52%)
 create mode 120000 apps/workbench/app/views/projects/_choose.js.erb
 create mode 100644 apps/workbench/app/views/projects/_index_jobs_and_pipelines.html.erb
 create mode 100644 apps/workbench/app/views/projects/_index_projects.html.erb
 create mode 100644 apps/workbench/app/views/projects/_show_contents.html.erb
 create mode 100644 apps/workbench/app/views/projects/_show_contents_rows.html.erb
 create mode 100644 apps/workbench/app/views/projects/_show_featured.html.erb
 create mode 100644 apps/workbench/app/views/projects/_show_permissions.html.erb
 create mode 100644 apps/workbench/app/views/projects/index.html.erb
 rename apps/workbench/app/views/{folders/remove_item.js.erb => projects/remove_items.js.erb} (100%)
 create mode 100644 apps/workbench/app/views/users/inactive.html.erb
 delete mode 100644 apps/workbench/test/functional/folders_controller_test.rb
 create mode 100644 apps/workbench/test/functional/projects_controller_test.rb
 delete mode 100644 apps/workbench/test/integration/folders_test.rb
 create mode 100644 apps/workbench/test/integration/projects_test.rb
 delete mode 100644 apps/workbench/test/unit/helpers/folders_helper_test.rb
 copy apps/workbench/test/unit/helpers/{groups_helper_test.rb => projects_helper_test.rb} (100%)
 create mode 100644 services/api/db/migrate/20140607150616_rename_folder_to_project.rb_deferred

       via  c14e0f75ffd65fdb01743170d3ffb6ecc14deccf (commit)
       via  d281c356f2df8f1596973f172f7affb4a51b0f31 (commit)
       via  11fecfd099b085dc7753c786119b2866b156ef7e (commit)
       via  63c77731e44e94cc3866a38bca08fe2d44d8bc05 (commit)
       via  64e95630b452d3dff9e2575b452ec9a1cad6f47b (commit)
       via  cec09589e50ced6d0b7a0d90d5ca124241d4a58a (commit)
       via  cacf29e090ca8cd94d7ab419191c6f26810fcd61 (commit)
       via  40df5992d4d8071a6e10a20ecdeb0470a80764cc (commit)
       via  4f1085f353d44600643a8e9dd6b43a39131e7946 (commit)
       via  62738e6c4087ad3001ea23bdb3e6b9c577701a55 (commit)
       via  358a23f9c4aa0016b5cfbee70c4897e2e8d4d871 (commit)
       via  960c1ba3447a80e4c8e063a49f6275a5b7532bc9 (commit)
       via  250fc95faf934e41d1b12e39a30a3dd0161bc955 (commit)
       via  30dc7784acaaf392599227a2e4b91e62303f7cfb (commit)
       via  55442fc4576a69bf41589a2572cda522227fb9ac (commit)
       via  f233795c54fbfd3b0481e5bce0914a9192e2b8ff (commit)
       via  bf43b9c625657fa745bbb237248f7d33ccb4cd2b (commit)
       via  a441b0496a0f217856f23ae084502afdba959e81 (commit)
       via  1b97a93f4a0e51836331c298c3946e02b6fe82ae (commit)
       via  6a4c33f0b3689f97d18b2d75f54787245c1ebeb9 (commit)
       via  719ba7f6247cf1697d81193b46bd768202ebb064 (commit)
       via  965700e2e2e981e1ba56c2101d3df2fd759ddb81 (commit)
       via  b64228f1f547c720b79a242d6d8d368a64923885 (commit)
       via  70542a2d6d6a2792f1dc68b1531e783e7611b474 (commit)
       via  c9ba2ec79e3e38bc3e1adc93173d82f1b763976b (commit)
       via  a959f21c8147f26362df392bc3fd3290db69de85 (commit)
       via  70f1004b17fac3c772c8f938b5a72ff3a3ebc67a (commit)
       via  f7ea83efa36ad9035cae34ac3b9ee5216347af20 (commit)
       via  0c88e01029446c985d5882fc3f45aa0f8549642a (commit)
       via  a91b4932e602f6534a326b8aa794b99454364776 (commit)
       via  0ac89aa2da962f381075e8924925bb7eb0982167 (commit)
       via  10c9634fe7a37377a01b8d49f56fb6ceb919fb10 (commit)
       via  417862967878f36338aa97c14e75501cbdcbdf16 (commit)
       via  77d2cc976232e08f00450bfc6bbbc041e072eb43 (commit)
       via  2cf679eb06b02a98f0597b709eaea581bbe82273 (commit)
       via  45008f2afc47a06d0eb39db0f32019dfb049a762 (commit)
       via  adf106e2d0db9e2cb8078759c5fcb8b12408e623 (commit)
       via  84fd14a1ee4b5534a6275b1c214bc6f39ece6f95 (commit)
       via  95cb55add68af9a0742ca8054c0c328658e5e651 (commit)
       via  e08c67024acccb83a30d2010c34862973b883585 (commit)
       via  a1f5f2c608f87b7bb59a4044cd02184a47494188 (commit)
       via  b2607e91145c2286eb6379abb5d3108eae8f4b30 (commit)
       via  563f568124876cc8577baec11caf33e73466b975 (commit)
       via  b6199657cd6867b05ab191da01e04e15ad10cc7d (commit)
       via  3ddef17b8c4893a1a0ba17cd7c1fd02ae6a47cb8 (commit)
       via  501ae28f1ed87af5f5d2b91546d8b973e1ee2a39 (commit)
       via  9172dbabe4340fd2011d712c13e12c893b238ea6 (commit)
       via  f8de38896834cce639a183daf84c601cd77cc5ee (commit)
       via  ade9fc709137c19429ac93eed00550ce8335373e (commit)
       via  4f6e2f4b6b289ca7b2016543b425b6b5c2da10bd (commit)
       via  203a0d4f3efb008ae3af6ec8fbb7b99d8a5dc757 (commit)
       via  743e9c54b5a97ebd8c2119e6f5b2953987e22f4b (commit)
       via  916a098440e4ad7900d297a5ee9914975d317177 (commit)
       via  181b57c695c23d140a8a5b2f772515cc63248ceb (commit)
       via  899075bc7866666322677b0dfb0b12844a495425 (commit)
       via  38e59df2cbeac1cc58962eabdfad49942b32c8f6 (commit)
       via  4c05d2bb163576a2de9e063f840904a19363c104 (commit)
       via  5ae6e2855194ecb5700e165b1d3796a385d4f507 (commit)
       via  192de21f18038794b56a1a0ec95c76e8e0eb1309 (commit)
       via  3c2ad38a0335977ce015c1b54267d466d85d2d1b (commit)
       via  d17532201983ac55fc395240f722338f34c7210b (commit)
       via  d9e2cb7b64063741b4b1243f9ad630f55be93840 (commit)
       via  ef378f40946e37c904234f933743e499d981faf3 (commit)
       via  ac84cd774f837fd1feced6e2f535fe4c2e0518a8 (commit)
       via  45648db225a107b6475c04c105f5db3c58570811 (commit)
       via  94e8dd9891a2c163f9d668f251c38e9a0979ef49 (commit)
       via  b2e29852fcb0aa34b7aeadfbee9db33abad485d7 (commit)
       via  f3ec0355f7b4bf30258316695fd4b01181596ad1 (commit)
       via  7df2da959b583d3646b9fde606f9e74d598d4bb9 (commit)
       via  80ab788943653194282c6a61cebc871f7944958f (commit)
       via  3792301ffcc75954caa41d5cc90abed465fbaf86 (commit)
       via  7f1e9f495fd2e335af08d7be54fb71eee6324421 (commit)
       via  a78b72118fba71b880194f04ed06007fdfb58743 (commit)
       via  918cf0b4e26b6149510bf72194be19b40121437d (commit)
       via  4a3301617ae09e6b28c7b6fd79923ccd60b6b5e9 (commit)
       via  25b1840819d60ed2cb6cb669921a6c3d9eba3f10 (commit)
       via  72b85b3144ca23e2c3337e38960dec9a0aec0ff8 (commit)
       via  811beeab989c5b8704ba78bcd365e7caf71bc615 (commit)
       via  5abef879fabdff46472e8f34def5d3b0cd332e99 (commit)
       via  a35f886c9a2ca73b55fcb21ca37bf1fa2a3a6fc2 (commit)
       via  70d7acb63d1f66fdde384e4bc7bfe439fe8abc35 (commit)
       via  d9814c9f51b177b15345bf4429baa2ce3b986a57 (commit)
       via  29487f418ff010e6ed536bc0a4d52997c1d0cd4f (commit)
       via  77225263b324d4a75f5f3fae1fd01d244dc4afa1 (commit)
       via  1f0868d558a44c6e3ca14240b92848cacd58a866 (commit)
       via  747efcd9371118c2db9c265c13ce399fc4b6c96b (commit)
       via  be778bdec0bb03b08699c6ee1343a0e791f5dfbf (commit)
       via  153642799375c2983363b48a40b05abb173750e6 (commit)
       via  421b1d641caa1dc3e1a3453b2f51e0b15ae268c2 (commit)
       via  92cb77cd08bbcc8ca0c0eab3aa5446efd43fb69f (commit)
       via  885a37384af5c3252f81518e6bcedc2abf50489b (commit)
       via  06f5f794cd1fc8cb4dbf72e3a2fbc440b44101b9 (commit)
       via  830678c2715bac06d581dcdce8ea518c1bcc2939 (commit)
       via  bff608d3f7430cb0f97d2ac185d1d7674c6b9ff8 (commit)
       via  a9f77ff084be7ad9caeb9e9601c022cb05e3c548 (commit)
       via  0a6ca2aada7bc0706fd1e41c1002cd6aa375c3a1 (commit)
       via  70ac6969e76770bcc6becfe94aa5811a0f320fcb (commit)
       via  1b981c1ca2e3d4d5aa6841fe2b334a19cc11f4f5 (commit)
       via  5758bd5c9ee5a253c695431f98d9e95b843e798e (commit)
       via  605522fc29649de26b7038e73339ffb35d12768e (commit)
       via  1b79dc4a25091e035a1c02693ecfcb8453649c27 (commit)
       via  b3cc51580f7d4bfa0c390e29950b2d605bfcda79 (commit)
       via  8cc28c45ca3da20e9d66aabbaf43de777c582a84 (commit)
      from  5e120ff28f90ff5ca4b3cf0d36e5c338a4be12f7 (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 c14e0f75ffd65fdb01743170d3ffb6ecc14deccf
Author: radhika <radhika at curoverse.com>
Date:   Sat Jun 14 10:03:46 2014 -0400

    2659: suppress actionable buttons when current user is anonymous

diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb
index f6cdaca..a369cb1 100644
--- a/apps/workbench/app/controllers/application_controller.rb
+++ b/apps/workbench/app/controllers/application_controller.rb
@@ -873,24 +873,6 @@ class ApplicationController < ActionController::Base
     @objects_for
   end
 
-  @@anonymous_user = nil
-  helper_method :anonymous_user
-  def anonymous_user
-    ApplicationController.anonymous_user
-  end
-  def self.anonymous_user
-    if !@@anonymous_user
-      anon_users = User.where(first_name: 'anonymouspublic', last_name: 'anonymouspublic')
-      anon_users.each do |user|
-        if user.uuid.ends_with? 'anonymouspublic'
-          @@anonymous_user = user
-          break
-        end
-      end
-    end
-    @@anonymous_user
-  end
-
   @@anonymous_group = nil
   def self.anonymous_group
     if !@@anonymous_group
diff --git a/apps/workbench/app/models/user.rb b/apps/workbench/app/models/user.rb
index 9c91477..66d8bcf 100644
--- a/apps/workbench/app/models/user.rb
+++ b/apps/workbench/app/models/user.rb
@@ -49,4 +49,12 @@ class User < ArvadosBase
     arvados_api_client.api(self, "/setup", params)
   end
 
+  def is_anonymous
+    self.uuid.andand.match(/anonymouspublic$/)
+  end
+
+  def can_act?
+    !self.is_anonymous # && self.is_active
+  end
+
 end
diff --git a/apps/workbench/app/views/layouts/application.html.erb b/apps/workbench/app/views/layouts/application.html.erb
index a3bcae7..97b139d 100644
--- a/apps/workbench/app/views/layouts/application.html.erb
+++ b/apps/workbench/app/views/layouts/application.html.erb
@@ -52,7 +52,9 @@
           <span class="icon-bar"></span>
           <span class="icon-bar"></span>
         </button>
-        <a class="navbar-brand" href="/"><%= Rails.configuration.site_name.downcase rescue Rails.application.class.parent_name %></a>
+        <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 %>
+        </a>
       </div>
 
       <div class="collapse navbar-collapse">
@@ -75,7 +77,7 @@
           -->
 
           <% if current_user %>
-          <% if current_user.uuid != anonymous_user.uuid %>
+          <% if current_user.can_act? %>
           <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>
@@ -98,12 +100,12 @@
               <% end %>
             </ul>
           </li>
-          <% else %>
+          <% elsif current_user.is_anonymous %>    <%# current user is anonymous %>
             <li><a href="<%= arvados_api_client.arvados_login_url(return_to: root_url) %>">Log in</a></li>
           <% end %>
           <% end %>
 
-          <% if !current_user.uuid.ends_with?('anonymouspublic') %>
+          <% if current_user.andand.can_act? %>
           <li class="dropdown selection-menu">
             <a href="#" class="dropdown-toggle" data-toggle="dropdown">
               <span class="fa fa-lg fa-paperclip"></span>
@@ -118,7 +120,7 @@
           </li>
           <% end %>
 
-          <% if current_user.is_active && !current_user.uuid.ends_with?('anonymouspublic') %>
+            <% if current_user.andand.can_act? %>
             <li class="dropdown">
               <a href="#" class="dropdown-toggle" data-toggle="dropdown" id="system-menu">
                 <span class="fa fa-lg fa-gear"></span>
@@ -155,7 +157,7 @@
                 </a></li>
               </ul>
             </li>
-          <% end %>
+            <% end %>
           <% else %>
             <li><a href="<%= arvados_api_client.arvados_login_url(return_to: root_url) %>">Log in</a></li>
           <% end %>
@@ -174,7 +176,7 @@
             </a>
             <ul class="dropdown-menu" role="menu">
               <li role="presentation" class="dropdown-header">
-                <% if current_user.uuid != anonymous_user.uuid %>
+                <% if current_user.can_act? %>
                 <%= 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 5106710..de11133 100644
--- a/apps/workbench/app/views/pipeline_instances/_show_inputs.html.erb
+++ b/apps/workbench/app/views/pipeline_instances/_show_inputs.html.erb
@@ -37,11 +37,13 @@
   <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? %>
   <%= link_to(url_for('pipeline_instance[state]' => 'RunningOnServer'),
       class: 'btn btn-primary run-pipeline-button',
       method: :patch
       ) do %>
     Run <i class="fa fa-fw fa-play"></i>
+<% end %>
   <% end %>
 
 <% end %>
diff --git a/apps/workbench/app/views/pipeline_instances/show.html.erb b/apps/workbench/app/views/pipeline_instances/show.html.erb
index 28972a4..2e35424 100644
--- a/apps/workbench/app/views/pipeline_instances/show.html.erb
+++ b/apps/workbench/app/views/pipeline_instances/show.html.erb
@@ -12,6 +12,7 @@
 <% end %>
 
 <% content_for :tab_line_buttons do %>
+  <% if current_user.andand.can_act? %>
   <%= 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',
@@ -27,6 +28,7 @@
         ) do %>
       Run <i class="fa fa-fw fa-play"></i>
     <% end %>
+  <% end %>
   <% else %>
     <% if @object.state.in? ['RunningOnClient', 'RunningOnServer'] %>
       <%= link_to(url_for('pipeline_instance[state]' => 'Paused'),
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 1624fd7..b606533 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,9 @@
 <% 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? %>
   <%= button_tag "Run this pipeline", {class: 'btn btn-primary pull-right', id: "run-pipeline-button"} %>
+  <% end %>
 <% 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 f18f515..e91800d 100644
--- a/apps/workbench/app/views/pipeline_templates/_show_recent.html.erb
+++ b/apps/workbench/app/views/pipeline_templates/_show_recent.html.erb
@@ -29,9 +29,11 @@
       <td>
         <%= form_tag '/pipeline_instances' do |f| %>
           <%= hidden_field :pipeline_instance, :pipeline_template_uuid, :value => ob.uuid %>
+          <% if current_user.andand.can_act? %>
           <%= button_tag nil, {class: "btn btn-default btn-xs", title: "Run #{ob.name}"} do %>
             Run <i class="fa fa-fw fa-play"></i>
           <% end %>
+          <% end %>
         <% end %>
       </td>
       <td>
diff --git a/apps/workbench/app/views/projects/index.html.erb b/apps/workbench/app/views/projects/index.html.erb
index 5fc7d7f..033317f 100644
--- a/apps/workbench/app/views/projects/index.html.erb
+++ b/apps/workbench/app/views/projects/index.html.erb
@@ -19,23 +19,23 @@
               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.uuid != anonymous_user.uuid %>
+              <% if current_user.andand.can_act? %>
               <b>To get started,</b> create a project using the "Add new project" button below.
               <% end %>
             </p>
           </div>
         </div>
       <% end %>
+
+      <% if current_user.andand.can_act? %>
       <div class="panel panel-default">
         <div class="panel-heading">
-          <% if current_user.uuid != anonymous_user.uuid %>
           <div class="pull-right">
             <%= button_to projects_path(method: 'post'), class: 'btn btn-xs btn-primary' do %>
               <i class="fa fa-fw fa-plus"></i>
               Add new project
             <% end %>
           </div>
-          <% end %>
           <h3 class="panel-title">
             My projects
           </h3>
@@ -44,6 +44,7 @@
           <%= render partial: 'index_projects', locals: {tree: my_project_tree, show_root_node: false} %>
         </div>
       </div>
+      <% end %>
     </div>
     <div class="col-sm-6">
       <div class="panel panel-default">
diff --git a/services/api/test/fixtures/groups.yml b/services/api/test/fixtures/groups.yml
index 0d6a5bb..cd6157b 100644
--- a/services/api/test/fixtures/groups.yml
+++ b/services/api/test/fixtures/groups.yml
@@ -93,3 +93,10 @@ anonymous_group:
   owner_uuid: zzzzz-tpzed-000000000000000
   name: Anonymous group
   description: Anonymous group
+
+anonymously_accessible_project:
+  uuid: zzzzz-j7d0g-zhxawtyetzwc5f0
+  owner_uuid: zzzzz-tpzed-d9tiejq69daie8f
+  name: Unrestricted public data
+  group_class: project
+  description: An anonymously accessible project
diff --git a/services/api/test/fixtures/links.yml b/services/api/test/fixtures/links.yml
index 1729bd2..6b54690 100644
--- a/services/api/test/fixtures/links.yml
+++ b/services/api/test/fixtures/links.yml
@@ -440,3 +440,42 @@ bug2931_link_with_null_head_uuid:
   tail_uuid: ~
   head_uuid: ~
   properties: {}
+
+anonymous_group_can_read_anonymously_accessible_project:
+  uuid: zzzzz-o0j2j-15gpzezqjg4bc4z
+  owner_uuid: zzzzz-tpzed-000000000000000
+  created_at: 2014-05-30 14:30:00.184389725 Z
+  modified_by_client_uuid: zzzzz-ozdt8-brczlopd8u8d0jr
+  modified_by_user_uuid: zzzzz-tpzed-000000000000000
+  modified_at: 2014-05-30 14:30:00.184019565 Z
+  updated_at: 2014-05-30 14:30:00.183829316 Z
+  link_class: permission
+  name: can_read
+  tail_uuid: zzzzz-j7d0g-anonymouspublic
+  head_uuid: zzzzz-j7d0g-zhxawtyetzwc5f0
+  properties: {}
+
+user_agreement_in_anonymously_accessible_project:
+  uuid: zzzzz-o0j2j-k0ukddp35mt6ok1
+  owner_uuid: zzzzz-j7d0g-zhxawtyetzwc5f0
+  created_at: 2014-06-13 20:42:26 -0800
+  modified_by_client_uuid: zzzzz-ozdt8-brczlopd8u8d0jr
+  modified_by_user_uuid: zzzzz-tpzed-d9tiejq69daie8f
+  modified_at: 2014-06-13 20:42:26 -0800
+  updated_at: 2014-06-13 20:42:26 -0800
+  link_class: name
+  name: GNU General Public License, version 3
+  tail_uuid: zzzzz-j7d0g-zhxawtyetzwc5f0
+  head_uuid: b519d9cb706a29fc7ea24dbea2f05851+249025
+  properties: {}
+
+user_agreement_readable_by_anonymously_accessible_project:
+  uuid: zzzzz-o0j2j-o5ds5gvhkztdc8h
+  owner_uuid: zzzzz-j7d0g-zhxawtyetzwc5f0
+  created_at: 2014-06-13 20:42:26 -0800
+  modified_by_client_uuid: zzzzz-ozdt8-brczlopd8u8d0jr
+  modified_by_user_uuid: zzzzz-tpzed-d9tiejq69daie8f
+  modified_at: 2014-06-13 20:42:26 -0800
+  updated_at: 2014-06-13 20:42:26 -0800
+  link_class: permission
+  name: can_read
diff --git a/services/api/test/unit/user_test.rb b/services/api/test/unit/user_test.rb
index 8f02779..d4f2524 100644
--- a/services/api/test/unit/user_test.rb
+++ b/services/api/test/unit/user_test.rb
@@ -60,7 +60,8 @@ class UserTest < ActiveSupport::TestCase
     assert @uninvited_user.can? :write=>"#{@uninvited_user.uuid}"
     assert @uninvited_user.can? :manage=>"#{@uninvited_user.uuid}"
 
-    assert @uninvited_user.groups_i_can(:read).size == 0, "inactive and uninvited user should not be able read any groups"
+    assert @uninvited_user.groups_i_can(:read).size == 1, "inactive and uninvited user can only read anonymous user group"
+    assert @uninvited_user.groups_i_can(:read).first.ends_with? 'anonymouspublic' , "inactive and uninvited user can only read anonymous user group"
     assert @uninvited_user.groups_i_can(:write).size == 0, "inactive and uninvited user should not be able write to any groups"
     assert @uninvited_user.groups_i_can(:manage).size == 0, "inactive and uninvited user should not be able manage any groups"
   end

commit d281c356f2df8f1596973f172f7affb4a51b0f31
Author: radhika <radhika at curoverse.com>
Date:   Fri Jun 13 18:58:20 2014 -0400

    2659: do not show gear menu and add new project buttons when the current user is anonymous user.

diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb
index c519f77..f6cdaca 100644
--- a/apps/workbench/app/controllers/application_controller.rb
+++ b/apps/workbench/app/controllers/application_controller.rb
@@ -354,6 +354,7 @@ class ApplicationController < ActionController::Base
     begin
       try_redirect_to_login = true
 
+      using_anonymous_user_token = false
       if !params[:api_token] && !session[:arvados_api_token]
         if session && (session['arv-referrer'] == 'logout')
           # do not use anonymous user token and let logout happen
@@ -872,10 +873,34 @@ class ApplicationController < ActionController::Base
     @objects_for
   end
 
+  @@anonymous_user = nil
+  helper_method :anonymous_user
+  def anonymous_user
+    ApplicationController.anonymous_user
+  end
+  def self.anonymous_user
+    if !@@anonymous_user
+      anon_users = User.where(first_name: 'anonymouspublic', last_name: 'anonymouspublic')
+      anon_users.each do |user|
+        if user.uuid.ends_with? 'anonymouspublic'
+          @@anonymous_user = user
+          break
+        end
+      end
+    end
+    @@anonymous_user
+  end
+
   @@anonymous_group = nil
   def self.anonymous_group
     if !@@anonymous_group
-      @@anonymous_group = Group.where(name: 'Anonymous group').first
+      anon_groups = @@anonymous_group = Group.where(name: 'Anonymous group')
+      anon_groups.each do |group|
+        if group.uuid.ends_with? 'anonymouspublic'
+          @@anonymous_group = group
+          break
+        end
+      end
     end
     @@anonymous_group
   end
diff --git a/apps/workbench/app/views/layouts/application.html.erb b/apps/workbench/app/views/layouts/application.html.erb
index 778268e..a3bcae7 100644
--- a/apps/workbench/app/views/layouts/application.html.erb
+++ b/apps/workbench/app/views/layouts/application.html.erb
@@ -75,6 +75,7 @@
           -->
 
           <% if current_user %>
+          <% if current_user.uuid != anonymous_user.uuid %>
           <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>
@@ -97,8 +98,12 @@
               <% end %>
             </ul>
           </li>
+          <% else %>
+            <li><a href="<%= arvados_api_client.arvados_login_url(return_to: root_url) %>">Log in</a></li>
+          <% end %>
           <% end %>
 
+          <% if !current_user.uuid.ends_with?('anonymouspublic') %>
           <li class="dropdown selection-menu">
             <a href="#" class="dropdown-toggle" data-toggle="dropdown">
               <span class="fa fa-lg fa-paperclip"></span>
@@ -111,8 +116,9 @@
               <% end %>
             </ul>
           </li>
+          <% end %>
 
-          <% if current_user.is_active %>
+          <% if current_user.is_active && !current_user.uuid.ends_with?('anonymouspublic') %>
             <li class="dropdown">
               <a href="#" class="dropdown-toggle" data-toggle="dropdown" id="system-menu">
                 <span class="fa fa-lg fa-gear"></span>
@@ -168,9 +174,11 @@
             </a>
             <ul class="dropdown-menu" role="menu">
               <li role="presentation" class="dropdown-header">
+                <% if current_user.uuid != anonymous_user.uuid %>
                 <%= 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 %>
+                <% end %>
                 My projects
               </li>
               <% my_project_tree.each do |pnode| %>
diff --git a/apps/workbench/app/views/projects/index.html.erb b/apps/workbench/app/views/projects/index.html.erb
index 2c76433..5fc7d7f 100644
--- a/apps/workbench/app/views/projects/index.html.erb
+++ b/apps/workbench/app/views/projects/index.html.erb
@@ -19,19 +19,23 @@
               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.uuid != anonymous_user.uuid %>
               <b>To get started,</b> create a project using the "Add new project" button below.
+              <% end %>
             </p>
           </div>
         </div>
       <% end %>
       <div class="panel panel-default">
         <div class="panel-heading">
+          <% if current_user.uuid != anonymous_user.uuid %>
           <div class="pull-right">
             <%= button_to projects_path(method: 'post'), class: 'btn btn-xs btn-primary' do %>
               <i class="fa fa-fw fa-plus"></i>
               Add new project
             <% end %>
           </div>
+          <% end %>
           <h3 class="panel-title">
             My projects
           </h3>
diff --git a/services/api/lib/current_api_client.rb b/services/api/lib/current_api_client.rb
index 448eeac..fbfd003 100644
--- a/services/api/lib/current_api_client.rb
+++ b/services/api/lib/current_api_client.rb
@@ -135,8 +135,9 @@ module CurrentApiClient
           $anonymous_user = User.new(uuid: anonymous_user_uuid,
                                      is_active: true,
                                      is_admin: false,
-                                     first_name: 'anonymous',
-                                     last_name: 'anonymous')
+                                     email: 'anonymouspublic',
+                                     first_name: 'anonymouspublic',
+                                     last_name: 'anonymouspublic')
           $anonymous_user.save!
           $anonymous_user.reload
 

commit 11fecfd099b085dc7753c786119b2866b156ef7e
Merge: 5e120ff 63c7773
Author: radhika <radhika at curoverse.com>
Date:   Fri Jun 13 16:24:02 2014 -0400

    Merge branch 'master' into 2659-anonymous-group

diff --cc apps/workbench/app/models/arvados_base.rb
index f9c364d,aca8786..5c14b37
--- a/apps/workbench/app/models/arvados_base.rb
+++ b/apps/workbench/app/models/arvados_base.rb
@@@ -291,10 -296,10 +296,10 @@@ class ArvadosBase < ActiveRecord::Bas
    end
  
    def self.creatable?
 -    current_user
 +    current_user && (!current_user[:uuid].ends_with?('anonymouspublic'))
    end
  
-   def self.goes_in_folders?
+   def self.goes_in_projects?
      false
    end
  

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list