5160: Workbench hides anonymous sharing when browsing disabled.
[arvados.git] / apps / workbench / app / views / application / _show_sharing.html.erb
index 23795d3f04a3a56ec99f30be5d4e438fb7d33875..4b7beb30592832261722e32be0dca21af35044ca 100644 (file)
    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"