1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
5 class CurrentApiClientHelper
6 extend CurrentApiClient
14 after :create do |user, evaluator|
15 CurrentApiClientHelper.act_as_system_user do
16 evaluator.join_groups.each do |g|
17 Link.create!(tail_uuid: user.uuid,
19 link_class: 'permission',
21 Link.create!(tail_uuid: g.uuid,
23 link_class: 'permission',
28 first_name { "Factory" }
29 last_name { "Factory" }
31 "https://example.com/#{rand(2**24).to_s(36)}"
33 factory :active_user do
35 after :create do |user|
36 CurrentApiClientHelper.act_as_system_user do
37 Link.create!(tail_uuid: user.uuid,
38 head_uuid: Group.where('uuid ~ ?', '-f+$').first.uuid,
39 link_class: 'permission',
44 to_create do |instance|
45 CurrentApiClientHelper.act_as_system_user do