5160: All users have API read permission to anonymous group.
[arvados.git] / services / api / lib / current_api_client.rb
index 6c1ff2807e12705edb108b4f92147a195eeff710..2e78612fc2d8b0ea3883cbb964d73c3e443e9c21 100644 (file)
@@ -146,6 +146,18 @@ module CurrentApiClient
     end
   end
 
+  def anonymous_group_read_permission
+    $anonymous_group_read_permission =
+        check_cache $anonymous_group_read_permission do
+      act_as_system_user do
+        Link.where(tail_uuid: all_users_group.uuid,
+                   head_uuid: anonymous_group.uuid,
+                   link_class: "permission",
+                   name: "can_read").first_or_create!
+      end
+    end
+  end
+
   def anonymous_user
     $anonymous_user = check_cache $anonymous_user do
       act_as_system_user do