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 = ? and link_class = ? and name = ? and tail_uuid = ? and head_uuid like ?",
27 Collection.uuid_like_pattern).
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 = ? and link_class = ? and name = ? and tail_uuid = ? and head_uuid like ?",
45 Collection.uuid_like_pattern)
47 @response_resource_name = 'link'
52 current_user_uuid = current_user.uuid
54 @object = Link.create(link_class: 'signature',
56 tail_uuid: current_user_uuid,
57 head_uuid: params[:uuid])
80 raise ArgumentError.new \
81 "Manage user agreements via Collections and Links instead."