[ARVADOS] updated: 92817fd6ff865ce40e54ea514175ae2f7bf14238

Git user git at public.curoverse.com
Wed Sep 13 15:51:53 EDT 2017


Summary of changes:
 services/api/app/models/arvados_model.rb          | 11 +++--------
 services/api/app/models/database_seeds.rb         |  3 +++
 services/api/test/integration/permissions_test.rb |  4 ----
 services/api/test/test_helper.rb                  |  6 ------
 4 files changed, 6 insertions(+), 18 deletions(-)

       via  92817fd6ff865ce40e54ea514175ae2f7bf14238 (commit)
       via  b6e83fea07e6eadaa8dafe3ea5d4626bde6cadbb (commit)
      from  607032817d0a3e4bc09a425634e207854dae05dc (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 92817fd6ff865ce40e54ea514175ae2f7bf14238
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Wed Sep 13 15:50:35 2017 -0400

    12032: Remove unnecessary checks on user_uuids.
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz at veritasgenetics.com>

diff --git a/services/api/app/models/arvados_model.rb b/services/api/app/models/arvados_model.rb
index 18f67cf..0828d01 100644
--- a/services/api/app/models/arvados_model.rb
+++ b/services/api/app/models/arvados_model.rb
@@ -271,25 +271,20 @@ class ArvadosModel < ActiveRecord::Base
         end
       end
     else
-      # Can read object (evidently a group or user) whose UUID is listed
-      # explicitly in user_uuids.
-      sql_conds.push "#{sql_table}.uuid IN (:user_uuids)"
-
       if include_trash
-        trashed_check = "true"
+        trashed_check = ""
       else
-        trashed_check = "trashed = 0"
+        trashed_check = "AND trashed = 0"
       end
 
       if sql_table != "api_client_authorizations" and sql_table != "groups"
         owner_check = "OR (target_uuid = #{sql_table}.owner_uuid AND target_owner_uuid IS NOT NULL)"
-        sql_conds.push "#{sql_table}.owner_uuid IN (:user_uuids)"
       else
         owner_check = ""
       end
 
       sql_conds.push "EXISTS(SELECT 1 FROM #{PERMISSION_VIEW} "+
-                     "WHERE user_uuid IN (:user_uuids) AND perm_level >= 1 AND #{trashed_check} AND (target_uuid = #{sql_table}.uuid #{owner_check}))"
+                     "WHERE user_uuid IN (:user_uuids) AND perm_level >= 1 #{trashed_check} AND (target_uuid = #{sql_table}.uuid #{owner_check}))"
 
       if sql_table == "links"
         # Match any permission link that gives one of the authorized

commit b6e83fea07e6eadaa8dafe3ea5d4626bde6cadbb
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Wed Sep 13 15:43:56 2017 -0400

    12032: Remove hopefully-unnecessary view refreshes between tests.
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz at veritasgenetics.com>

diff --git a/services/api/app/models/database_seeds.rb b/services/api/app/models/database_seeds.rb
index 6e7ab9b..436a8c6 100644
--- a/services/api/app/models/database_seeds.rb
+++ b/services/api/app/models/database_seeds.rb
@@ -2,6 +2,8 @@
 #
 # SPDX-License-Identifier: AGPL-3.0
 
+require 'refresh_permission_view'
+
 class DatabaseSeeds
   extend CurrentApiClient
   def self.install
@@ -12,5 +14,6 @@ class DatabaseSeeds
     anonymous_group_read_permission
     anonymous_user
     empty_collection
+    refresh_permission_view
   end
 end
diff --git a/services/api/test/integration/permissions_test.rb b/services/api/test/integration/permissions_test.rb
index f8f1e25..49fa473 100644
--- a/services/api/test/integration/permissions_test.rb
+++ b/services/api/test/integration/permissions_test.rb
@@ -9,10 +9,6 @@ class PermissionsTest < ActionDispatch::IntegrationTest
   include CurrentApiClient  # for empty_collection
   fixtures :users, :groups, :api_client_authorizations, :collections
 
-  teardown do
-    User.invalidate_permissions_cache db_current_time.to_i
-  end
-
   test "adding and removing direct can_read links" do
     # try to read collection as spectator
     get "/arvados/v1/collections/#{collections(:foo_file).uuid}", {:format => :json}, auth(:spectator)
diff --git a/services/api/test/test_helper.rb b/services/api/test/test_helper.rb
index 6c330dd..d874bc4 100644
--- a/services/api/test/test_helper.rb
+++ b/services/api/test/test_helper.rb
@@ -67,7 +67,6 @@ class ActiveSupport::TestCase
     Thread.current[:api_client] = nil
     Thread.current[:user] = nil
     restore_configuration
-    User.invalidate_permissions_cache
   end
 
   def assert_equal(expect, *args)
@@ -145,10 +144,6 @@ class ActionController::TestCase
     @test_counter = 0
   end
 
-  teardown do
-    User.invalidate_permissions_cache
-  end
-
   def check_counter action
     @test_counter += 1
     if @test_counter == 2
@@ -186,7 +181,6 @@ class ActionDispatch::IntegrationTest
     Thread.current[:api_client_uuid] = nil
     Thread.current[:api_client] = nil
     Thread.current[:user] = nil
-    User.invalidate_permissions_cache
   end
 end
 

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list