1 class Arvados::V1::UserAgreementsController < ApplicationController
2 before_filter :admin_required, except: [:index, :sign, :signatures]
3 skip_before_filter :find_object, only: [:sign, :signatures]
14 if not current_user.is_invited
15 # New users cannot see user agreements until/unless invited to
16 # use this installation.
19 current_user_uuid = current_user.uuid
21 uuids = Link.where(owner_uuid: system_user_uuid,
22 link_class: 'signature',
24 tail_kind: 'arvados#user',
25 tail_uuid: system_user_uuid,
26 head_kind: 'arvados#collection').
28 @objects = Collection.where('uuid in (?)', uuids)
31 @response_resource_name = 'collection'
36 current_user_uuid = (current_user.andand.is_admin && params[:uuid]) ||
39 @objects = Link.where(owner_uuid: system_user_uuid,
40 link_class: 'signature',
42 tail_kind: 'arvados#user',
43 tail_uuid: current_user_uuid,
44 head_kind: 'arvados#collection')
46 @response_resource_name = 'link'
51 current_user_uuid = current_user.uuid
53 @object = Link.create(link_class: 'signature',
55 tail_kind: 'arvados#user',
56 tail_uuid: current_user_uuid,
57 head_kind: 'arvados#collection',
58 head_uuid: params[:uuid])
81 raise ArgumentError.new \
82 "Manage user agreements via Collections and Links instead."