X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/b1ef43a1dbb4a66e1646fc68ac88ff6d54026ac1..9aa380dbc94f9fb8be43e3fb691dadfcbefff94c:/services/api/app/controllers/database_controller.rb diff --git a/services/api/app/controllers/database_controller.rb b/services/api/app/controllers/database_controller.rb index 21c8e4710c..5c4cf7bc16 100644 --- a/services/api/app/controllers/database_controller.rb +++ b/services/api/app/controllers/database_controller.rb @@ -1,7 +1,11 @@ +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: AGPL-3.0 + class DatabaseController < ApplicationController - skip_before_filter :find_object_by_uuid - skip_before_filter :render_404_if_no_object - before_filter :admin_required + skip_before_action :find_object_by_uuid + skip_before_action :render_404_if_no_object + before_action :admin_required def reset raise ArvadosModel::PermissionDeniedError unless Rails.env == 'test' @@ -10,8 +14,8 @@ class DatabaseController < ApplicationController # use @example.com email addresses when creating user records, so # we can tell they're not valuable. user_uuids = User. - where('email is null or email not like ?', '%@example.com'). - collect &:uuid + where('email is null or (email not like ? and email not like ?)', '%@example.com', '%.example.com'). + collect(&:uuid) fixture_uuids = YAML::load_file(File.expand_path('../../../test/fixtures/users.yml', __FILE__)). @@ -51,8 +55,8 @@ class DatabaseController < ApplicationController # create_fixtures() is a no-op for cached fixture sets, so # uncache them all. - ActiveRecord::Fixtures.reset_cache - ActiveRecord::Fixtures. + ActiveRecord::FixtureSet.reset_cache + ActiveRecord::FixtureSet. create_fixtures(Rails.root.join('test', 'fixtures'), fixturesets) # Dump cache of permissions etc. @@ -71,6 +75,11 @@ class DatabaseController < ApplicationController raise end + require 'update_permissions' + + refresh_permissions + refresh_trashed + # Done. send_json success: true end