11906: use the same name "ManagementToken" to enable healthcheck in all services
[arvados.git] / services / api / app / models / arvados_model.rb
index bb33c5595aea267c4dc996545f1d73d3006b3453..ea69735502b92a93f5e55b09bf3ceebb4a646dbb 100644 (file)
@@ -1,3 +1,7 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
 require 'has_uuid'
 require 'record_filters'
 require 'serializers'
@@ -250,7 +254,8 @@ class ArvadosModel < ActiveRecord::Base
 
     # Check if any of the users are admin.  If so, we're done.
     if users_list.select { |u| u.is_admin }.any?
-      return self
+      # Return existing relation with no new filters.
+      return where({})
     end
 
     # Collect the UUIDs of the authorized users.