1 class Arvados::V1::UserAgreementsController < ApplicationController
2 before_filter :admin_required, except: [:index, :sign, :signatures]
3 skip_before_filter :find_object_by_uuid, only: [:sign, :signatures]
4 skip_before_filter :render_404_if_no_object, only: [:sign, :signatures]
15 if not current_user.is_invited
16 # New users cannot see user agreements until/unless invited to
17 # use this installation.
20 current_user_uuid = current_user.uuid
22 uuids = Link.where(owner_uuid: system_user_uuid,
23 link_class: 'signature',
25 tail_kind: 'arvados#user',
26 tail_uuid: system_user_uuid,
27 head_kind: 'arvados#collection').
29 @objects = Collection.where('uuid in (?)', uuids)
32 @response_resource_name = 'collection'
37 current_user_uuid = (current_user.andand.is_admin && params[:uuid]) ||
40 @objects = Link.where(owner_uuid: system_user_uuid,
41 link_class: 'signature',
43 tail_kind: 'arvados#user',
44 tail_uuid: current_user_uuid,
45 head_kind: 'arvados#collection')
47 @response_resource_name = 'link'
52 current_user_uuid = current_user.uuid
54 @object = Link.create(link_class: 'signature',
56 tail_kind: 'arvados#user',
57 tail_uuid: current_user_uuid,
58 head_kind: 'arvados#collection',
59 head_uuid: params[:uuid])
82 raise ArgumentError.new \
83 "Manage user agreements via Collections and Links instead."