1 class Arvados::V1::UserAgreementsController < ApplicationController
2 before_filter :admin_required, except: [:index, :sign, :signatures]
3 skip_before_filter :find_object, only: [:sign, :signatures]
10 if not current_user.is_invited
11 # New users cannot see user agreements until/unless invited to
12 # use this installation.
15 current_user_uuid = current_user.uuid
17 uuids = Link.where(owner_uuid: system_user_uuid,
18 link_class: 'signature',
20 tail_kind: 'arvados#user',
21 tail_uuid: system_user_uuid,
22 head_kind: 'arvados#collection').
24 @objects = Collection.where('uuid in (?)', uuids)
27 @response_resource_name = 'collection'
32 current_user_uuid = (current_user.andand.is_admin && params[:uuid]) ||
35 @objects = Link.where(owner_uuid: system_user_uuid,
36 link_class: 'signature',
38 tail_kind: 'arvados#user',
39 tail_uuid: current_user_uuid,
40 head_kind: 'arvados#collection')
42 @response_resource_name = 'link'
47 current_user_uuid = current_user.uuid
49 @object = Link.create(link_class: 'signature',
51 tail_kind: 'arvados#user',
52 tail_uuid: current_user_uuid,
53 head_kind: 'arvados#collection',
54 head_uuid: params[:uuid])
77 raise ArgumentError.new \
78 "Manage user agreements via Collections and Links instead."