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.
21 uuids = Link.where("owner_uuid = ? and link_class = ? and name = ? and tail_uuid = ? and head_uuid like ?",
26 Collection.uuid_like_pattern).
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 = ? and link_class = ? and name = ? and tail_uuid = ? and head_uuid like ?",
44 Collection.uuid_like_pattern)
46 @response_resource_name = 'link'
51 current_user_uuid = current_user.uuid
53 @object = Link.create(link_class: 'signature',
55 tail_uuid: current_user_uuid,
56 head_uuid: params[:uuid])
79 raise ArgumentError.new \
80 "Manage user agreements via Collections and Links instead."