[ARVADOS] updated: f102390c598ec819f31fdccc603f19c39eb9e1c8
git at public.curoverse.com
git at public.curoverse.com
Tue Feb 10 11:36:43 EST 2015
Summary of changes:
.../app/views/application/_show_sharing.html.erb | 9 +++++++
apps/workbench/config/application.default.yml | 4 ++--
apps/workbench/test/integration/projects_test.rb | 28 ++++++++++++++++++++++
services/api/test/fixtures/groups.yml | 5 ++--
4 files changed, 42 insertions(+), 4 deletions(-)
via f102390c598ec819f31fdccc603f19c39eb9e1c8 (commit)
via 4e31431aef9a645073187a820cde46c838c67b90 (commit)
via 6b0bd95655767b8d97b3a1356b7dcde7ecb2cd90 (commit)
from 488846259a3a8a3a5f9845279a73b569d998a199 (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 f102390c598ec819f31fdccc603f19c39eb9e1c8
Author: Brett Smith <brett at curoverse.com>
Date: Tue Feb 10 11:33:59 2015 -0500
5160: Workbench hides anonymous sharing when browsing disabled.
This commit updates Workbench to filter out the anonymous group from
the group sharing modal when anonymous browsing is disabled. That
helps avoid situations where users think their work is publicly
sharable, but that's been disabled by the administrator.
diff --git a/apps/workbench/app/views/application/_show_sharing.html.erb b/apps/workbench/app/views/application/_show_sharing.html.erb
index 23795d3..4b7beb3 100644
--- a/apps/workbench/app/views/application/_show_sharing.html.erb
+++ b/apps/workbench/app/views/application/_show_sharing.html.erb
@@ -22,6 +22,15 @@
choose_filters = {
"groups" => [["group_class", "=", "role"]],
}
+ if not Rails.configuration.anonymous_user_token
+ # It would be ideal to filter out the anonymous group by UUID,
+ # but that's not readily doable. Workbench can't generate the
+ # UUID for a != filter, because it can't introspect the API
+ # server's UUID prefix. And we can't say "uuid not like
+ # %-anonymouspublic", because the API server doesn't support a
+ # "not like" filter.
+ choose_filters["groups"] << ["name", "!=", "Anonymous users"]
+ end
choose_filters.default = []
owner_icon = fa_icon_class_for_uuid(@object.owner_uuid)
if owner_icon == "fa-users"
diff --git a/apps/workbench/test/integration/projects_test.rb b/apps/workbench/test/integration/projects_test.rb
index 7f051f6..73a23d6 100644
--- a/apps/workbench/test/integration/projects_test.rb
+++ b/apps/workbench/test/integration/projects_test.rb
@@ -172,6 +172,34 @@ class ProjectsTest < ActionDispatch::IntegrationTest
"Project 5678 should now be inside project 1234")
end
+ def open_groups_sharing(project_name="aproject", token_name="active")
+ project = api_fixture("groups", project_name)
+ visit(page_with_token(token_name, "/projects/#{project['uuid']}"))
+ click_on "Sharing"
+ click_on "Share with groups"
+ end
+
+ def group_name(group_key)
+ api_fixture("groups", group_key, "name")
+ end
+
+ test "projects not publicly sharable when anonymous browsing disabled" do
+ Rails.configuration.anonymous_user_token = false
+ open_groups_sharing
+ # Check for a group we do expect first, to make sure the modal's loaded.
+ assert_selector(".modal-container .selectable",
+ text: group_name("all_users"))
+ assert_no_selector(".modal-container .selectable",
+ text: group_name("anonymous_group"))
+ end
+
+ test "projects publicly sharable when anonymous browsing enabled" do
+ Rails.configuration.anonymous_user_token = "testonlytoken"
+ open_groups_sharing
+ assert_selector(".modal-container .selectable",
+ text: group_name("anonymous_group"))
+ end
+
test "project viewer can't see project sharing tab" do
show_object_using('project_viewer', 'groups', 'aproject', 'A Project')
assert(page.has_no_link?("Sharing"),
commit 4e31431aef9a645073187a820cde46c838c67b90
Author: Brett Smith <brett at curoverse.com>
Date: Tue Feb 10 11:25:16 2015 -0500
5160: Make anonymous group fixture match database seed.
Refer to /services/api/app/models/database_seeds.rb.
diff --git a/services/api/test/fixtures/groups.yml b/services/api/test/fixtures/groups.yml
index 86815c0..fb23c8c 100644
--- a/services/api/test/fixtures/groups.yml
+++ b/services/api/test/fixtures/groups.yml
@@ -116,8 +116,9 @@ bad_group_has_ownership_cycle_b:
anonymous_group:
uuid: zzzzz-j7d0g-anonymouspublic
owner_uuid: zzzzz-tpzed-000000000000000
- name: Anonymous group
- description: Anonymous group
+ name: Anonymous users
+ group_class: role
+ description: Anonymous users
anonymously_accessible_project:
uuid: zzzzz-j7d0g-zhxawtyetzwc5f0
commit 6b0bd95655767b8d97b3a1356b7dcde7ecb2cd90
Author: Brett Smith <brett at curoverse.com>
Date: Tue Feb 10 09:00:01 2015 -0500
5160: Fix typo in Workbench default config comments.
diff --git a/apps/workbench/config/application.default.yml b/apps/workbench/config/application.default.yml
index f43e8c6..54a1f2e 100644
--- a/apps/workbench/config/application.default.yml
+++ b/apps/workbench/config/application.default.yml
@@ -191,7 +191,7 @@ common:
# the maximum number of bytes to load in the log viewer
log_viewer_max_bytes: 1000000
- # Set anonymous user token to enable anonymous user access. You can get
+ # Set anonymous_user_token to enable anonymous user access. You can get
# the token by running "bundle exec ./script/get_anonymous_user_token.rb"
- # in the directory where you API server is running.
+ # in the directory where your API server is running.
anonymous_user_token: false
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list