skip_before_filter :render_404_if_no_object, only:
[:activate, :event_stream, :current, :system, :setup]
before_filter :admin_required, only: [:setup, :unsetup]
-
+
def current
@object = current_user
show
end
end
end
-
+
def event_stream
channel = current_user.andand.uuid
if current_user.andand.is_admin
raise ArgumentError.new "Cannot activate without being invited."
end
act_as_system_user do
- required_uuids = Link.where(owner_uuid: system_user_uuid,
- link_class: 'signature',
- name: 'require',
- tail_uuid: system_user_uuid,
- head_kind: 'arvados#collection').
+ required_uuids = Link.where("owner_uuid = ? and link_class = ? and name = ? and tail_uuid = ? and head_uuid like ?",
+ system_user_uuid,
+ 'signature',
+ 'require',
+ system_user_uuid,
+ Collection.uuid_like_pattern).
collect(&:head_uuid)
signed_uuids = Link.where(owner_uuid: system_user_uuid,
link_class: 'signature',
name: 'click',
- tail_kind: 'arvados#user',
tail_uuid: @object.uuid,
- head_kind: 'arvados#collection',
head_uuid: required_uuids).
collect(&:head_uuid)
todo_uuids = required_uuids - signed_uuids
end
if object_found
- @response = @object.setup_repo_vm_links params[:repo_name], params[:vm_uuid]
+ @response = @object.setup_repo_vm_links params[:repo_name],
+ params[:vm_uuid], params[:openid_prefix]
else
@response = User.setup @object, params[:openid_prefix],
params[:repo_name], params[:vm_uuid]
end
- render json: { kind: "arvados#HashList", items: @response }
+ render json: { kind: "arvados#HashList", items: @response.as_api_response(nil) }
end
# delete user agreements, vm, repository, login links; set state to inactive
def unsetup
- @object = User.find_by_uuid params[:uuid]
- @object = @object.unsetup
+ reload_object_before_update
+ @object.unsetup
show
end