From 5620a47e20e004188e0f1d0245ae9e916575e806 Mon Sep 17 00:00:00 2001 From: Tom Clegg Date: Mon, 8 Jul 2013 14:18:43 -0400 Subject: [PATCH] rename foreign uuid attributes --- .../app/controllers/collections_controller.rb | 2 +- .../app/controllers/groups_controller.rb | 4 +- .../app/controllers/users_controller.rb | 2 +- apps/workbench/app/models/arvados_base.rb | 18 +-- .../application/_arvados_object_attr.html.erb | 2 +- .../app/views/application/_index.html.erb | 2 +- .../workbench/app/views/groups/index.html.erb | 4 +- apps/workbench/app/views/links/index.html.erb | 2 +- .../views/pipeline_instances/index.html.erb | 2 +- .../views/pipeline_templates/index.html.erb | 2 +- apps/workbench/app/views/users/index.html.erb | 2 +- doc/api/Collections.textile | 2 +- doc/api/Jobs.textile | 4 +- doc/api/authentication.textile | 4 +- doc/api/methods.textile | 4 +- doc/api/resources.textile | 4 +- doc/install/install-api-server.md | 2 +- sdk/python/arvados.py | 2 +- .../app/controllers/application_controller.rb | 6 +- .../controllers/arvados/v1/jobs_controller.rb | 2 +- .../app/models/api_client_authorization.rb | 20 +-- services/api/app/models/arvados_model.rb | 24 +-- services/api/app/models/job.rb | 10 +- services/api/app/models/job_task.rb | 6 +- services/api/app/models/link.rb | 2 +- services/api/app/models/user.rb | 8 +- ...08163414_rename_foreign_uuid_attributes.rb | 16 ++ services/api/db/schema.rb | 144 +++++++++--------- services/api/lib/common_api_template.rb | 6 +- services/api/lib/current_api_client.rb | 2 +- services/api/script/crunch-dispatch.rb | 2 +- services/api/test/fixtures/api_clients.yml | 8 +- .../api/test/fixtures/authorized_keys.yml | 12 +- services/api/test/fixtures/collections.yml | 12 +- services/api/test/fixtures/humans.yml | 12 +- services/api/test/fixtures/logs.yml | 8 +- services/api/test/fixtures/specimens.yml | 8 +- services/api/test/fixtures/traits.yml | 12 +- services/api/test/fixtures/users.yml | 8 +- .../api/test/fixtures/virtual_machines.yml | 12 +- services/crunch/crunch-job | 12 +- 41 files changed, 216 insertions(+), 200 deletions(-) create mode 100644 services/api/db/migrate/20130708163414_rename_foreign_uuid_attributes.rb diff --git a/apps/workbench/app/controllers/collections_controller.rb b/apps/workbench/app/controllers/collections_controller.rb index 92d2ad0976..5c5e16b6da 100644 --- a/apps/workbench/app/controllers/collections_controller.rb +++ b/apps/workbench/app/controllers/collections_controller.rb @@ -27,7 +27,7 @@ class CollectionsController < ApplicationController c[:created_at] = l.head.created_at end c[:wanted] = true - if l.owner == current_user.uuid + if l.owner_uuid == current_user.uuid c[:wanted_by_me] = true end end diff --git a/apps/workbench/app/controllers/groups_controller.rb b/apps/workbench/app/controllers/groups_controller.rb index a924db2dce..daf8ab94ed 100644 --- a/apps/workbench/app/controllers/groups_controller.rb +++ b/apps/workbench/app/controllers/groups_controller.rb @@ -4,13 +4,13 @@ class GroupsController < ApplicationController def index @groups = Group.limit(10000).all @group_uuids = @groups.collect &:uuid - @owned_users = User.where owner: @group_uuids + @owned_users = User.where owner_uuid: @group_uuids @links_from = Link.where link_class: 'permission', tail_uuid: @group_uuids @links_to = Link.where link_class: 'permission', head_uuid: @group_uuids end def show - @collections = Collection.where(owner: @object.uuid) + @collections = Collection.where(owner_uuid: @object.uuid) @names = {} @keep_flag = {} @pgp_hu_id = {} diff --git a/apps/workbench/app/controllers/users_controller.rb b/apps/workbench/app/controllers/users_controller.rb index 62007ff1c7..e15dc23559 100644 --- a/apps/workbench/app/controllers/users_controller.rb +++ b/apps/workbench/app/controllers/users_controller.rb @@ -22,7 +22,7 @@ class UsersController < ApplicationController # A Tutorial is a Link which has link_class "resources" and name # "wants", and is owned by the Tutorials Group (i.e., named # "Arvados Tutorials" and owned by the system user). - @tutorial_group = Group.where(owner: User.system.uuid, + @tutorial_group = Group.where(owner_uuid: User.system.uuid, name: 'Arvados Tutorials').first if @tutorial_group @tutorial_links = Link.where(tail_uuid: @tutorial_group.uuid, diff --git a/apps/workbench/app/models/arvados_base.rb b/apps/workbench/app/models/arvados_base.rb index 6b8278d0ec..83588f0aa0 100644 --- a/apps/workbench/app/models/arvados_base.rb +++ b/apps/workbench/app/models/arvados_base.rb @@ -25,11 +25,11 @@ class ArvadosBase < ActiveRecord::Base @attribute_sortkey ||= { 'id' => nil, 'uuid' => '000', - 'owner' => '001', + 'owner_uuid' => '001', 'created_at' => '002', 'modified_at' => '003', - 'modified_by_user' => '004', - 'modified_by_client' => '005', + 'modified_by_user_uuid' => '004', + 'modified_by_client_uuid' => '005', 'name' => '050', 'tail_kind' => '100', 'tail_uuid' => '100', @@ -109,8 +109,8 @@ class ArvadosBase < ActiveRecord::Base @kind = resp[:kind] # these attrs can be modified by "save" -- we should update our copies - %w(uuid owner created_at - modified_at modified_by_user modified_by_client + %w(uuid owner_uuid created_at + modified_at modified_by_user_uuid modified_by_client_uuid ).each do |attr| if self.respond_to? "#{attr}=".to_sym self.send(attr + '=', resp[attr.to_sym]) @@ -216,18 +216,18 @@ class ArvadosBase < ActiveRecord::Base def editable? (current_user and current_user.is_active and (current_user.is_admin or - current_user.uuid == self.owner)) + current_user.uuid == self.owner_uuid)) end def attribute_editable?(attr) - if "created_at modified_at modified_by_user modified_by_client updated_at".index(attr.to_s) + if "created_at modified_at modified_by_user_uuid modified_by_client_uuid updated_at".index(attr.to_s) false elsif not (current_user.andand.is_active) false - elsif "uuid owner".index(attr.to_s) or current_user.is_admin + elsif "uuid owner_uuid".index(attr.to_s) or current_user.is_admin current_user.is_admin else - current_user.uuid == self.owner or current_user.uuid == self.uuid + current_user.uuid == self.owner_uuid or current_user.uuid == self.uuid end end diff --git a/apps/workbench/app/views/application/_arvados_object_attr.html.erb b/apps/workbench/app/views/application/_arvados_object_attr.html.erb index 3809f59b9b..ce175cc2f6 100644 --- a/apps/workbench/app/views/application/_arvados_object_attr.html.erb +++ b/apps/workbench/app/views/application/_arvados_object_attr.html.erb @@ -15,7 +15,7 @@ <% end %> <% elsif attrvalue.is_a? String or attrvalue.respond_to? :to_s %> - + <%= attr %> <% if attr == 'uuid' and (uuid = attrvalue.split('-')).size == 3 %> <%= uuid[0..-2].join('-') %>-<%= uuid[-1] %> diff --git a/apps/workbench/app/views/application/_index.html.erb b/apps/workbench/app/views/application/_index.html.erb index 632d61bc9b..888bcee74c 100644 --- a/apps/workbench/app/views/application/_index.html.erb +++ b/apps/workbench/app/views/application/_index.html.erb @@ -6,7 +6,7 @@ <% else %> -<% attr_blacklist = 'created_at modified_at modified_by_user modified_by_client updated_at' %> +<% attr_blacklist = 'created_at modified_at modified_by_user_uuid modified_by_client_uuid updated_at' %> diff --git a/apps/workbench/app/views/groups/index.html.erb b/apps/workbench/app/views/groups/index.html.erb index bd8a33bf99..1e81518169 100644 --- a/apps/workbench/app/views/groups/index.html.erb +++ b/apps/workbench/app/views/groups/index.html.erb @@ -26,13 +26,13 @@ diff --git a/apps/workbench/app/views/links/index.html.erb b/apps/workbench/app/views/links/index.html.erb index 08d175d753..76e959a243 100644 --- a/apps/workbench/app/views/links/index.html.erb +++ b/apps/workbench/app/views/links/index.html.erb @@ -37,7 +37,7 @@ diff --git a/apps/workbench/app/views/pipeline_instances/index.html.erb b/apps/workbench/app/views/pipeline_instances/index.html.erb index dbf58a71ad..f5b672d916 100644 --- a/apps/workbench/app/views/pipeline_instances/index.html.erb +++ b/apps/workbench/app/views/pipeline_instances/index.html.erb @@ -38,7 +38,7 @@ diff --git a/apps/workbench/app/views/users/index.html.erb b/apps/workbench/app/views/users/index.html.erb index 0bcb714be9..442d47ef0a 100644 --- a/apps/workbench/app/views/users/index.html.erb +++ b/apps/workbench/app/views/users/index.html.erb @@ -36,7 +36,7 @@ diff --git a/doc/api/Collections.textile b/doc/api/Collections.textile index a700e54ead..afebd33772 100644 --- a/doc/api/Collections.textile +++ b/doc/api/Collections.textile @@ -36,6 +36,6 @@ table(table table-bordered table-condensed). |*Property name*|*Value*|*Description*| |portable_data_hash|string|| |redundancy|number|| -|redundancy_confirmed_by_client|string|API client| +|redundancy_confirmed_by_client_uuid|string|API client| |redundancy_confirmed_at|datetime|| |redundancy_confirmed_as|number|| diff --git a/doc/api/Jobs.textile b/doc/api/Jobs.textile index 8c374a4eeb..b9b08dcedb 100644 --- a/doc/api/Jobs.textile +++ b/doc/api/Jobs.textile @@ -31,7 +31,7 @@ GET https://{{ site.arvados_api_host }}/arvados/v1/jobs/queue POST https://{{ site.arvados_api_host }}/arvados/v1/jobs/queue _method=GET -where[owner]=xyzzy-tpzed-a4lcehql0dv2u25 +where[owner_uuid]=xyzzy-tpzed-a4lcehql0dv2u25 → Job resource list @@ -57,7 +57,7 @@ table(table table-bordered table-condensed). |finished_at|datetime|When job finished running|Is null if job has not [yet] finished| |running|boolean|Whether the job is running|| |success|boolean|Whether the job indicated successful completion|Is null if job has not finished| -|is_locked_by|string|UUID of the user who has locked this job|Is null if job is not locked. The system user locks the job when starting the job, in order to prevent job attributes from being altered.| +|is_locked_by_uuid|string|UUID of the user who has locked this job|Is null if job is not locked. The system user locks the job when starting the job, in order to prevent job attributes from being altered.| h3. Resource limits diff --git a/doc/api/authentication.textile b/doc/api/authentication.textile index fea46bb9cd..e48be7df51 100644 --- a/doc/api/authentication.textile +++ b/doc/api/authentication.textile @@ -17,8 +17,8 @@ Many resources contain "actor" attributes like @modified_by@. An @access_token@ table(table table-bordered table-condensed). |Name|Type|Description| -|modified_by_client|string|ID of API client| -|modified_by_user|string|ID of authenticated user| +|modified_by_client_uuid|string|ID of API client| +|modified_by_user_uuid|string|ID of authenticated user| h2. Authorizing a client application diff --git a/doc/api/methods.textile b/doc/api/methods.textile index 00656ceff8..5b47d3f55d 100644 --- a/doc/api/methods.textile +++ b/doc/api/methods.textile @@ -12,11 +12,11 @@ h1. REST Methods h2(#index). Index, list, search
-GET https://{{ site.arvados_api_host }}/arvados/v1/groups?where[owner]=xyzzy-tpzed-a4lcehql0dv2u25
+GET https://{{ site.arvados_api_host }}/arvados/v1/groups?where[owner_uuid]=xyzzy-tpzed-a4lcehql0dv2u25
  
 POST https://{{ site.arvados_api_host }}/arvados/v1/groups
 _method=GET
-where[owner]=xyzzy-tpzed-a4lcehql0dv2u25
+where[owner_uuid]=xyzzy-tpzed-a4lcehql0dv2u25
 
→ Group resource list diff --git a/doc/api/resources.textile b/doc/api/resources.textile index c839433170..038ce9dde9 100644 --- a/doc/api/resources.textile +++ b/doc/api/resources.textile @@ -25,8 +25,8 @@ table(table table-bordered table-condensed). |self_link|string||| |owner_uuid|string|UUID of owner (typically User or Project)|@mk2qn-tpzed-a4lcehql0dv2u25@| |created_at|datetime|When resource was created|@2013-01-21T22:17:39Z@| -|modified_by_client|string|API client software which most recently modified the resource|@mk2qn-ozdt8-vq8l5qkzj7pr7h7@| -|modified_by_user|string|Authenticated user, on whose behalf the client was acting when modifying the resource|@mk2qn-tpzed-a4lcehql0dv2u25@| +|modified_by_client_uuid|string|API client software which most recently modified the resource|@mk2qn-ozdt8-vq8l5qkzj7pr7h7@| +|modified_by_user_uuid|string|Authenticated user, on whose behalf the client was acting when modifying the resource|@mk2qn-tpzed-a4lcehql0dv2u25@| |modified_at|datetime|When resource was last modified|@2013-01-25T22:29:32Z@| h2. Attributes of resource lists diff --git a/doc/install/install-api-server.md b/doc/install/install-api-server.md index f9535f2f4c..b27f9c9774 100644 --- a/doc/install/install-api-server.md +++ b/doc/install/install-api-server.md @@ -108,6 +108,6 @@ This should be In rails console - a = ApiClient.new(owner:1); a.save! + a = ApiClient.new(owner_uuid:'0'); a.save! x = ApiClientAuthorization.new(api_client_id:a.id, user_id:1); x.save; x.api_token diff --git a/sdk/python/arvados.py b/sdk/python/arvados.py index 0ae5ad0c06..f017b1e06e 100644 --- a/sdk/python/arvados.py +++ b/sdk/python/arvados.py @@ -97,7 +97,7 @@ class job_setup: task_input = f.as_manifest() new_task_attrs = { 'job_uuid': current_job()['uuid'], - 'created_by_job_task': current_task()['uuid'], + 'created_by_job_task_uuid': current_task()['uuid'], 'sequence': if_sequence + 1, 'parameters': { 'input':task_input diff --git a/services/api/app/controllers/application_controller.rb b/services/api/app/controllers/application_controller.rb index d212cd2218..9dd23e8d9a 100644 --- a/services/api/app/controllers/application_controller.rb +++ b/services/api/app/controllers/application_controller.rb @@ -115,8 +115,8 @@ class ApplicationController < ActionController::Base or_references_me = "OR (#{table_name}.link_class in (#{model_class.sanitize 'permission'}, #{model_class.sanitize 'resources'}) AND #{model_class.sanitize current_user.uuid} IN (#{table_name}.head_uuid, #{table_name}.tail_uuid))" end @objects ||= model_class. - joins("LEFT JOIN links permissions ON permissions.head_uuid in (#{table_name}.owner, #{table_name}.uuid) AND permissions.tail_uuid in (#{sanitized_uuid_list}) AND permissions.link_class='permission'"). - where("?=? OR #{table_name}.owner in (?) OR #{table_name}.uuid=? OR permissions.head_uuid IS NOT NULL #{or_references_me}", + joins("LEFT JOIN links permissions ON permissions.head_uuid in (#{table_name}.owner_uuid, #{table_name}.uuid) AND permissions.tail_uuid in (#{sanitized_uuid_list}) AND permissions.link_class='permission'"). + where("?=? OR #{table_name}.owner_uuid in (?) OR #{table_name}.uuid=? OR permissions.head_uuid IS NOT NULL #{or_references_me}", true, current_user.is_admin, uuid_list, current_user.uuid) @@ -199,7 +199,7 @@ class ApplicationController < ActionController::Base message << " hash provided with request" raise ArgumentError.new(message) end - %w(created_at modified_by_client modified_by_user modified_at).each do |x| + %w(created_at modified_by_client_uuid modified_by_user_uuid modified_at).each do |x| @attrs.delete x end @attrs diff --git a/services/api/app/controllers/arvados/v1/jobs_controller.rb b/services/api/app/controllers/arvados/v1/jobs_controller.rb index 759f437fd5..c330da5122 100644 --- a/services/api/app/controllers/arvados/v1/jobs_controller.rb +++ b/services/api/app/controllers/arvados/v1/jobs_controller.rb @@ -74,7 +74,7 @@ class Arvados::V1::JobsController < ApplicationController load_where_param @where.merge!({ started_at: nil, - is_locked_by: nil, + is_locked_by_uuid: nil, cancelled_at: nil }) params[:order] ||= 'priority desc, created_at' diff --git a/services/api/app/models/api_client_authorization.rb b/services/api/app/models/api_client_authorization.rb index c71d0dce4b..e90d7980cd 100644 --- a/services/api/app/models/api_client_authorization.rb +++ b/services/api/app/models/api_client_authorization.rb @@ -7,12 +7,12 @@ class ApiClientAuthorization < ArvadosModel after_initialize :assign_random_api_token api_accessible :superuser, :extend => :common do |t| - t.add :owner + t.add :owner_uuid t.add :user_id t.add :api_client_id t.add :api_token t.add :created_by_ip_address - t.add :default_owner + t.add :default_owner_uuid t.add :expires_at t.add :last_used_at t.add :last_used_by_ip_address @@ -22,13 +22,13 @@ class ApiClientAuthorization < ArvadosModel self.api_token ||= rand(2**256).to_s(36) end - def owner + def owner_uuid self.user.andand.uuid end - def owner_was + def owner_uuid_was self.user_id_changed? ? User.find(self.user_id_was).andand.uuid : self.user.andand.uuid end - def owner_changed? + def owner_uuid_changed? self.user_id_changed? end @@ -43,15 +43,15 @@ class ApiClientAuthorization < ArvadosModel self.api_token_changed? end - def modified_by_client + def modified_by_client_uuid nil end - def modified_by_client=(x) end + def modified_by_client_uuid=(x) end - def modified_by_user + def modified_by_user_uuid nil end - def modified_by_user=(x) end + def modified_by_user_uuid=(x) end def modified_at nil @@ -67,6 +67,6 @@ class ApiClientAuthorization < ArvadosModel def permission_to_update (permission_to_create and not self.user_id_changed? and - not self.owner_changed?) + not self.owner_uuid_changed?) end end diff --git a/services/api/app/models/arvados_model.rb b/services/api/app/models/arvados_model.rb index c5c3dd2579..09b61413b4 100644 --- a/services/api/app/models/arvados_model.rb +++ b/services/api/app/models/arvados_model.rb @@ -4,8 +4,8 @@ class ArvadosModel < ActiveRecord::Base include CurrentApiClient # current_user, current_api_client, etc. attr_protected :created_at - attr_protected :modified_by_user - attr_protected :modified_by_client + attr_protected :modified_by_user_uuid + attr_protected :modified_by_client_uuid attr_protected :modified_at before_create :ensure_permission_to_create before_update :ensure_permission_to_update @@ -63,22 +63,22 @@ class ArvadosModel < ActiveRecord::Base return false end return true if current_user.is_admin - if self.owner_changed? - if current_user.uuid == self.owner or - current_user.can? write: self.owner + if self.owner_uuid_changed? + if current_user.uuid == self.owner_uuid or + current_user.can? write: self.owner_uuid # current_user is, or has :write permission on, the new owner else - logger.warn "User #{current_user.uuid} tried to change owner of #{self.class.to_s} #{self.uuid} to #{self.owner} but does not have permission to write to #{self.owner}" + logger.warn "User #{current_user.uuid} tried to change owner_uuid of #{self.class.to_s} #{self.uuid} to #{self.owner_uuid} but does not have permission to write to #{self.owner_uuid}" return false end end - if current_user.uuid == self.owner_was or + if current_user.uuid == self.owner_uuid_was or current_user.uuid == self.uuid or - current_user.can? write: self.owner_was + current_user.can? write: self.owner_uuid_was # current user is, or has :write permission on, the previous owner return true else - logger.warn "User #{current_user.uuid} tried to modify #{self.class.to_s} #{self.uuid} but does not have permission to write #{self.owner_was}" + logger.warn "User #{current_user.uuid} tried to modify #{self.class.to_s} #{self.uuid} but does not have permission to write #{self.owner_uuid_was}" return false end end @@ -89,10 +89,10 @@ class ArvadosModel < ActiveRecord::Base def update_modified_by_fields self.created_at ||= Time.now - self.owner ||= current_default_owner + self.owner_uuid ||= current_default_owner self.modified_at = Time.now - self.modified_by_user = current_user ? current_user.uuid : nil - self.modified_by_client = current_api_client ? current_api_client.uuid : nil + self.modified_by_user_uuid = current_user ? current_user.uuid : nil + self.modified_by_client_uuid = current_api_client ? current_api_client.uuid : nil end def ensure_serialized_attribute_type diff --git a/services/api/app/models/job.rb b/services/api/app/models/job.rb index e2fc19e852..9167d15d8a 100644 --- a/services/api/app/models/job.rb +++ b/services/api/app/models/job.rb @@ -28,7 +28,7 @@ class Job < ArvadosModel t.add :output t.add :success t.add :running - t.add :is_locked_by + t.add :is_locked_by_uuid t.add :log t.add :resource_limits t.add :tasks_summary @@ -42,7 +42,7 @@ class Job < ArvadosModel end def self.queue - self.where('started_at is ? and is_locked_by is ? and cancelled_at is ?', + self.where('started_at is ? and is_locked_by_uuid is ? and cancelled_at is ?', nil, nil, nil). order('priority desc, created_at') end @@ -50,7 +50,7 @@ class Job < ArvadosModel protected def ensure_script_version_is_commit - if self.is_locked_by and self.started_at + if self.is_locked_by_uuid and self.started_at # Apparently client has already decided to go for it. This is # needed to run a local job using a local working directory # instead of a commit-ish. @@ -114,8 +114,8 @@ class Job < ArvadosModel elsif is_locked_by_was and is_locked_by_was != current_user.uuid logger.warn "User #{current_user.uuid} tried to steal lock on #{self.class.to_s} #{uuid_was} from #{is_locked_by_was}" false - elsif !is_locked_by.nil? and is_locked_by != current_user.uuid - logger.warn "User #{current_user.uuid} tried to lock #{self.class.to_s} #{uuid_was} with uuid #{is_locked_by}" + elsif !is_locked_by_uuid.nil? and is_locked_by_uuid != current_user.uuid + logger.warn "User #{current_user.uuid} tried to lock #{self.class.to_s} #{uuid_was} with uuid #{is_locked_by_uuid}" false else super diff --git a/services/api/app/models/job_task.rb b/services/api/app/models/job_task.rb index 4616e9f8b6..e2f7930087 100644 --- a/services/api/app/models/job_task.rb +++ b/services/api/app/models/job_task.rb @@ -8,7 +8,7 @@ class JobTask < ArvadosModel api_accessible :superuser, :extend => :common do |t| t.add :job_uuid - t.add :created_by_job_task + t.add :created_by_job_task_uuid t.add :sequence t.add :qsequence t.add :parameters @@ -21,7 +21,7 @@ class JobTask < ArvadosModel def delete_created_job_tasks_if_failed if self.success == false and self.success != self.success_was - JobTask.delete_all ['created_by_job_task = ?', self.uuid] + JobTask.delete_all ['created_by_job_task_uuid = ?', self.uuid] end end @@ -30,7 +30,7 @@ class JobTask < ArvadosModel # xxx qsequence should be sequential as advertised; for now at # least it's non-decreasing. JobTask.update_all(['qsequence = ?', (Time.now.to_f*10000000).to_i], - ['created_by_job_task = ?', self.uuid]) + ['created_by_job_task_uuid = ?', self.uuid]) end end end diff --git a/services/api/app/models/link.rb b/services/api/app/models/link.rb index b685bb6d75..af7226b6df 100644 --- a/services/api/app/models/link.rb +++ b/services/api/app/models/link.rb @@ -47,7 +47,7 @@ class Link < ArvadosModel where('uuid=?',head_uuid). first if head_obj - return true if head_obj.owner == current_user.uuid + return true if head_obj.owner_uuid == current_user.uuid end # Users with "can_grant" permission on an object can grant diff --git a/services/api/app/models/user.rb b/services/api/app/models/user.rb index 68e23804c1..2fb3df3926 100644 --- a/services/api/app/models/user.rb +++ b/services/api/app/models/user.rb @@ -40,10 +40,10 @@ class User < ArvadosModel next if target_uuid == self.uuid next if (group_permissions[target_uuid] and group_permissions[target_uuid][action]) - if target.respond_to? :owner - next if target.owner == self.uuid - next if (group_permissions[target.owner] and - group_permissions[target.owner][action]) + if target.respond_to? :owner_uuid + next if target.owner_uuid == self.uuid + next if (group_permissions[target.owner_uuid] and + group_permissions[target.owner_uuid][action]) end return false end diff --git a/services/api/db/migrate/20130708163414_rename_foreign_uuid_attributes.rb b/services/api/db/migrate/20130708163414_rename_foreign_uuid_attributes.rb new file mode 100644 index 0000000000..122571b251 --- /dev/null +++ b/services/api/db/migrate/20130708163414_rename_foreign_uuid_attributes.rb @@ -0,0 +1,16 @@ +class RenameForeignUuidAttributes < ActiveRecord::Migration + def change + rename_column :api_client_authorizations, :default_owner, :default_owner_uuid + [:api_clients, :authorized_keys, :collections, + :groups, :humans, :job_tasks, :jobs, :keep_disks, + :links, :logs, :nodes, :pipeline_instances, :pipeline_templates, + :repositories, :specimens, :traits, :users, :virtual_machines].each do |t| + rename_column t, :owner, :owner_uuid + rename_column t, :modified_by_client, :modified_by_client_uuid + rename_column t, :modified_by_user, :modified_by_user_uuid + end + rename_column :collections, :redundancy_confirmed_by_client, :redundancy_confirmed_by_client_uuid + rename_column :jobs, :is_locked_by, :is_locked_by_uuid + rename_column :job_tasks, :created_by_job_task, :created_by_job_task_uuid + end +end diff --git a/services/api/db/schema.rb b/services/api/db/schema.rb index 34d1763579..37a9586c90 100644 --- a/services/api/db/schema.rb +++ b/services/api/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20130627184333) do +ActiveRecord::Schema.define(:version => 20130708163414) do create_table "api_client_authorizations", :force => true do |t| t.string "api_token", :null => false @@ -23,7 +23,7 @@ ActiveRecord::Schema.define(:version => 20130627184333) do t.datetime "expires_at" t.datetime "created_at" t.datetime "updated_at" - t.string "default_owner" + t.string "default_owner_uuid" end add_index "api_client_authorizations", ["api_client_id"], :name => "index_api_client_authorizations_on_api_client_id" @@ -33,15 +33,15 @@ ActiveRecord::Schema.define(:version => 20130627184333) do create_table "api_clients", :force => true do |t| t.string "uuid" - t.string "owner" - t.string "modified_by_client" - t.string "modified_by_user" + t.string "owner_uuid" + t.string "modified_by_client_uuid" + t.string "modified_by_user_uuid" t.datetime "modified_at" t.string "name" t.string "url_prefix" t.datetime "created_at" t.datetime "updated_at" - t.boolean "is_trusted", :default => false + t.boolean "is_trusted", :default => false end add_index "api_clients", ["created_at"], :name => "index_api_clients_on_created_at" @@ -49,10 +49,10 @@ ActiveRecord::Schema.define(:version => 20130627184333) do add_index "api_clients", ["uuid"], :name => "index_api_clients_on_uuid", :unique => true create_table "authorized_keys", :force => true do |t| - t.string "uuid", :null => false - t.string "owner", :null => false - t.string "modified_by_client" - t.string "modified_by_user" + t.string "uuid", :null => false + t.string "owner_uuid", :null => false + t.string "modified_by_client_uuid" + t.string "modified_by_user_uuid" t.datetime "modified_at" t.string "name" t.string "key_type" @@ -68,15 +68,15 @@ ActiveRecord::Schema.define(:version => 20130627184333) do create_table "collections", :force => true do |t| t.string "locator" - t.string "owner" + t.string "owner_uuid" t.datetime "created_at" - t.string "modified_by_client" - t.string "modified_by_user" + t.string "modified_by_client_uuid" + t.string "modified_by_user_uuid" t.datetime "modified_at" t.string "portable_data_hash" t.string "name" t.integer "redundancy" - t.string "redundancy_confirmed_by_client" + t.string "redundancy_confirmed_by_client_uuid" t.datetime "redundancy_confirmed_at" t.integer "redundancy_confirmed_as" t.datetime "updated_at" @@ -111,10 +111,10 @@ ActiveRecord::Schema.define(:version => 20130627184333) do create_table "groups", :force => true do |t| t.string "uuid" - t.string "owner" + t.string "owner_uuid" t.datetime "created_at" - t.string "modified_by_client" - t.string "modified_by_user" + t.string "modified_by_client_uuid" + t.string "modified_by_user_uuid" t.datetime "modified_at" t.string "name" t.text "description" @@ -126,10 +126,10 @@ ActiveRecord::Schema.define(:version => 20130627184333) do add_index "groups", ["uuid"], :name => "index_groups_on_uuid", :unique => true create_table "humans", :force => true do |t| - t.string "uuid", :null => false - t.string "owner", :null => false - t.string "modified_by_client" - t.string "modified_by_user" + t.string "uuid", :null => false + t.string "owner_uuid", :null => false + t.string "modified_by_client_uuid" + t.string "modified_by_user_uuid" t.datetime "modified_at" t.text "properties" t.datetime "created_at" @@ -140,9 +140,9 @@ ActiveRecord::Schema.define(:version => 20130627184333) do create_table "job_tasks", :force => true do |t| t.string "uuid" - t.string "owner" - t.string "modified_by_client" - t.string "modified_by_user" + t.string "owner_uuid" + t.string "modified_by_client_uuid" + t.string "modified_by_user_uuid" t.datetime "modified_at" t.string "job_uuid" t.integer "sequence" @@ -152,8 +152,8 @@ ActiveRecord::Schema.define(:version => 20130627184333) do t.boolean "success" t.datetime "created_at" t.datetime "updated_at" - t.string "created_by_job_task" - t.integer "qsequence", :limit => 8 + t.string "created_by_job_task_uuid" + t.integer "qsequence", :limit => 8 end add_index "job_tasks", ["created_at"], :name => "index_job_tasks_on_created_at" @@ -165,9 +165,9 @@ ActiveRecord::Schema.define(:version => 20130627184333) do create_table "jobs", :force => true do |t| t.string "uuid" - t.string "owner" - t.string "modified_by_client" - t.string "modified_by_user" + t.string "owner_uuid" + t.string "modified_by_client_uuid" + t.string "modified_by_user_uuid" t.datetime "modified_at" t.string "submit_id" t.string "script" @@ -184,7 +184,7 @@ ActiveRecord::Schema.define(:version => 20130627184333) do t.datetime "created_at" t.datetime "updated_at" t.string "priority" - t.string "is_locked_by" + t.string "is_locked_by_uuid" t.string "log" t.text "tasks_summary" t.text "resource_limits" @@ -200,18 +200,18 @@ ActiveRecord::Schema.define(:version => 20130627184333) do add_index "jobs", ["uuid"], :name => "index_jobs_on_uuid", :unique => true create_table "keep_disks", :force => true do |t| - t.string "uuid", :null => false - t.string "owner", :null => false - t.string "modified_by_client" - t.string "modified_by_user" + t.string "uuid", :null => false + t.string "owner_uuid", :null => false + t.string "modified_by_client_uuid" + t.string "modified_by_user_uuid" t.datetime "modified_at" - t.string "ping_secret", :null => false + t.string "ping_secret", :null => false t.string "node_uuid" t.string "filesystem_uuid" t.integer "bytes_total" t.integer "bytes_free" - t.boolean "is_readable", :default => true, :null => false - t.boolean "is_writable", :default => true, :null => false + t.boolean "is_readable", :default => true, :null => false + t.boolean "is_writable", :default => true, :null => false t.datetime "last_read_at" t.datetime "last_write_at" t.datetime "last_ping_at" @@ -230,10 +230,10 @@ ActiveRecord::Schema.define(:version => 20130627184333) do create_table "links", :force => true do |t| t.string "uuid" - t.string "owner" + t.string "owner_uuid" t.datetime "created_at" - t.string "modified_by_client" - t.string "modified_by_user" + t.string "modified_by_client_uuid" + t.string "modified_by_user_uuid" t.datetime "modified_at" t.string "tail_uuid" t.string "tail_kind" @@ -255,9 +255,9 @@ ActiveRecord::Schema.define(:version => 20130627184333) do create_table "logs", :force => true do |t| t.string "uuid" - t.string "owner" - t.string "modified_by_client" - t.string "modified_by_user" + t.string "owner_uuid" + t.string "modified_by_client_uuid" + t.string "modified_by_user_uuid" t.string "object_kind" t.string "object_uuid" t.datetime "event_at" @@ -280,10 +280,10 @@ ActiveRecord::Schema.define(:version => 20130627184333) do create_table "nodes", :force => true do |t| t.string "uuid" - t.string "owner" + t.string "owner_uuid" t.datetime "created_at" - t.string "modified_by_client" - t.string "modified_by_user" + t.string "modified_by_client_uuid" + t.string "modified_by_user_uuid" t.datetime "modified_at" t.integer "slot_number" t.string "hostname" @@ -303,16 +303,16 @@ ActiveRecord::Schema.define(:version => 20130627184333) do create_table "pipeline_instances", :force => true do |t| t.string "uuid" - t.string "owner" + t.string "owner_uuid" t.datetime "created_at" - t.string "modified_by_client" - t.string "modified_by_user" + t.string "modified_by_client_uuid" + t.string "modified_by_user_uuid" t.datetime "modified_at" t.string "pipeline_template_uuid" t.string "name" t.text "components" t.boolean "success" - t.boolean "active", :default => false + t.boolean "active", :default => false t.datetime "updated_at" t.text "properties" end @@ -323,10 +323,10 @@ ActiveRecord::Schema.define(:version => 20130627184333) do create_table "pipeline_templates", :force => true do |t| t.string "uuid" - t.string "owner" + t.string "owner_uuid" t.datetime "created_at" - t.string "modified_by_client" - t.string "modified_by_user" + t.string "modified_by_client_uuid" + t.string "modified_by_user_uuid" t.datetime "modified_at" t.string "name" t.text "components" @@ -338,10 +338,10 @@ ActiveRecord::Schema.define(:version => 20130627184333) do add_index "pipeline_templates", ["uuid"], :name => "index_pipeline_templates_on_uuid", :unique => true create_table "repositories", :force => true do |t| - t.string "uuid", :null => false - t.string "owner", :null => false - t.string "modified_by_client" - t.string "modified_by_user" + t.string "uuid", :null => false + t.string "owner_uuid", :null => false + t.string "modified_by_client_uuid" + t.string "modified_by_user_uuid" t.datetime "modified_at" t.string "name" t.string "fetch_url" @@ -355,10 +355,10 @@ ActiveRecord::Schema.define(:version => 20130627184333) do create_table "specimens", :force => true do |t| t.string "uuid" - t.string "owner" + t.string "owner_uuid" t.datetime "created_at" - t.string "modified_by_client" - t.string "modified_by_user" + t.string "modified_by_client_uuid" + t.string "modified_by_user_uuid" t.datetime "modified_at" t.string "material" t.datetime "updated_at" @@ -370,10 +370,10 @@ ActiveRecord::Schema.define(:version => 20130627184333) do add_index "specimens", ["uuid"], :name => "index_specimens_on_uuid", :unique => true create_table "traits", :force => true do |t| - t.string "uuid", :null => false - t.string "owner", :null => false - t.string "modified_by_client" - t.string "modified_by_user" + t.string "uuid", :null => false + t.string "owner_uuid", :null => false + t.string "modified_by_client_uuid" + t.string "modified_by_user_uuid" t.datetime "modified_at" t.string "name" t.text "properties" @@ -386,10 +386,10 @@ ActiveRecord::Schema.define(:version => 20130627184333) do create_table "users", :force => true do |t| t.string "uuid" - t.string "owner" + t.string "owner_uuid" t.datetime "created_at" - t.string "modified_by_client" - t.string "modified_by_user" + t.string "modified_by_client_uuid" + t.string "modified_by_user_uuid" t.datetime "modified_at" t.string "email" t.string "first_name" @@ -399,7 +399,7 @@ ActiveRecord::Schema.define(:version => 20130627184333) do t.text "prefs" t.datetime "updated_at" t.string "default_owner" - t.boolean "is_active", :default => false + t.boolean "is_active", :default => false end add_index "users", ["created_at"], :name => "index_users_on_created_at" @@ -407,10 +407,10 @@ ActiveRecord::Schema.define(:version => 20130627184333) do add_index "users", ["uuid"], :name => "index_users_on_uuid", :unique => true create_table "virtual_machines", :force => true do |t| - t.string "uuid", :null => false - t.string "owner", :null => false - t.string "modified_by_client" - t.string "modified_by_user" + t.string "uuid", :null => false + t.string "owner_uuid", :null => false + t.string "modified_by_client_uuid" + t.string "modified_by_user_uuid" t.datetime "modified_at" t.string "hostname" t.datetime "created_at" diff --git a/services/api/lib/common_api_template.rb b/services/api/lib/common_api_template.rb index 1dec3fa5b4..7b7478e25b 100644 --- a/services/api/lib/common_api_template.rb +++ b/services/api/lib/common_api_template.rb @@ -6,10 +6,10 @@ module CommonApiTemplate t.add :kind t.add :etag t.add :uuid - t.add :owner + t.add :owner_uuid t.add :created_at - t.add :modified_by_client - t.add :modified_by_user + t.add :modified_by_client_uuid + t.add :modified_by_user_uuid t.add :modified_at t.add :updated_at end diff --git a/services/api/lib/current_api_client.rb b/services/api/lib/current_api_client.rb index f7476a9bed..96009977cd 100644 --- a/services/api/lib/current_api_client.rb +++ b/services/api/lib/current_api_client.rb @@ -12,7 +12,7 @@ module CurrentApiClient end def current_default_owner - # owner uuid for newly created objects + # owner_uuid for newly created objects ((current_api_client_authorization && current_api_client_authorization.default_owner) || (current_user && current_user.default_owner) || diff --git a/services/api/script/crunch-dispatch.rb b/services/api/script/crunch-dispatch.rb index dc739870ad..0bcb5d56c0 100755 --- a/services/api/script/crunch-dispatch.rb +++ b/services/api/script/crunch-dispatch.rb @@ -80,7 +80,7 @@ class Dispatcher end job_auth = ApiClientAuthorization. - new(user: User.where('uuid=?', job.modified_by_user).first, + new(user: User.where('uuid=?', job.modified_by_user_uuid).first, api_client_id: 0) job_auth.save diff --git a/services/api/test/fixtures/api_clients.yml b/services/api/test/fixtures/api_clients.yml index a0f04df131..ff74b8ae1d 100644 --- a/services/api/test/fixtures/api_clients.yml +++ b/services/api/test/fixtures/api_clients.yml @@ -4,8 +4,8 @@ one: uuid: MyString created_by_client: MyString created_by_user: MyString - modified_by_client: MyString - modified_by_user: MyString + modified_by_client_uuid: MyString + modified_by_user_uuid: MyString modified_at: 2013-01-23 10:02:24 name: MyString url_prefix: MyString @@ -14,8 +14,8 @@ two: uuid: MyString created_by_client: MyString created_by_user: MyString - modified_by_client: MyString - modified_by_user: MyString + modified_by_client_uuid: MyString + modified_by_user_uuid: MyString modified_at: 2013-01-23 10:02:24 name: MyString url_prefix: MyString diff --git a/services/api/test/fixtures/authorized_keys.yml b/services/api/test/fixtures/authorized_keys.yml index 3b7fe2d142..01f8901728 100644 --- a/services/api/test/fixtures/authorized_keys.yml +++ b/services/api/test/fixtures/authorized_keys.yml @@ -2,9 +2,9 @@ one: uuid: MyString - owner: MyString - modified_by_client: MyString - modified_by_user: MyString + owner_uuid: MyString + modified_by_client_uuid: MyString + modified_by_user_uuid: MyString modified_at: 2013-06-06 14:35:19 name: MyString key_type: MyString @@ -14,9 +14,9 @@ one: two: uuid: MyString - owner: MyString - modified_by_client: MyString - modified_by_user: MyString + owner_uuid: MyString + modified_by_client_uuid: MyString + modified_by_user_uuid: MyString modified_at: 2013-06-06 14:35:19 name: MyString key_type: MyString diff --git a/services/api/test/fixtures/collections.yml b/services/api/test/fixtures/collections.yml index 76d8bbec8c..d89251070f 100644 --- a/services/api/test/fixtures/collections.yml +++ b/services/api/test/fixtures/collections.yml @@ -5,13 +5,13 @@ one: created_by_client: MyString created_by_user: MyString created_at: 2012-10-15 20:50:09 - modified_by_client: MyString - modified_by_user: MyString + modified_by_client_uuid: MyString + modified_by_user_uuid: MyString modified_at: 2012-10-15 20:50:09 portable_data_hash: MyString name: MyString redundancy: 1 - redundancy_confirmed_by_client: MyString + redundancy_confirmed_by_client_uuid: MyString redundancy_confirmed_at: 2012-10-15 20:50:09 redundancy_confirmed_as: 1 @@ -20,12 +20,12 @@ two: created_by_client: MyString created_by_user: MyString created_at: 2012-10-15 20:50:09 - modified_by_client: MyString - modified_by_user: MyString + modified_by_client_uuid: MyString + modified_by_user_uuid: MyString modified_at: 2012-10-15 20:50:09 portable_data_hash: MyString name: MyString redundancy: 1 - redundancy_confirmed_by_client: MyString + redundancy_confirmed_by_client_uuid: MyString redundancy_confirmed_at: 2012-10-15 20:50:09 redundancy_confirmed_as: 1 diff --git a/services/api/test/fixtures/humans.yml b/services/api/test/fixtures/humans.yml index e93e9a5ec6..cf83af44b4 100644 --- a/services/api/test/fixtures/humans.yml +++ b/services/api/test/fixtures/humans.yml @@ -2,16 +2,16 @@ one: uuid: MyString - owner: MyString - modified_by_client: MyString - modified_by_user: MyString + owner_uuid: MyString + modified_by_client_uuid: MyString + modified_by_user_uuid: MyString modified_at: 2013-06-27 14:43:33 properties: MyText two: uuid: MyString - owner: MyString - modified_by_client: MyString - modified_by_user: MyString + owner_uuid: MyString + modified_by_client_uuid: MyString + modified_by_user_uuid: MyString modified_at: 2013-06-27 14:43:33 properties: MyText diff --git a/services/api/test/fixtures/logs.yml b/services/api/test/fixtures/logs.yml index c892854a9f..ec6597e5d6 100644 --- a/services/api/test/fixtures/logs.yml +++ b/services/api/test/fixtures/logs.yml @@ -4,8 +4,8 @@ one: uuid: MyString created_by_client: MyString created_by_user: MyString - modified_by_client: MyString - modified_by_user: MyString + modified_by_client_uuid: MyString + modified_by_user_uuid: MyString object_kind: MyString object_uuid: MyString event_at: 2013-01-22 12:14:42 @@ -17,8 +17,8 @@ two: uuid: MyString created_by_client: MyString created_by_user: MyString - modified_by_client: MyString - modified_by_user: MyString + modified_by_client_uuid: MyString + modified_by_user_uuid: MyString object_kind: MyString object_uuid: MyString event_at: 2013-01-22 12:14:42 diff --git a/services/api/test/fixtures/specimens.yml b/services/api/test/fixtures/specimens.yml index 17aa8a7b5e..2b1deb8074 100644 --- a/services/api/test/fixtures/specimens.yml +++ b/services/api/test/fixtures/specimens.yml @@ -6,8 +6,8 @@ one: created_by_client: MyString created_by_user: MyString modified_at: 2013-01-15 18:42:33 - modified_by_client: MyString - modified_by_user: MyString + modified_by_client_uuid: MyString + modified_by_user_uuid: MyString material: MyString two: @@ -16,6 +16,6 @@ two: created_by_client: MyString created_by_user: MyString modified_at: 2013-01-15 18:42:33 - modified_by_client: MyString - modified_by_user: MyString + modified_by_client_uuid: MyString + modified_by_user_uuid: MyString material: MyString diff --git a/services/api/test/fixtures/traits.yml b/services/api/test/fixtures/traits.yml index 594081f3ca..5cd827c38b 100644 --- a/services/api/test/fixtures/traits.yml +++ b/services/api/test/fixtures/traits.yml @@ -2,18 +2,18 @@ one: uuid: MyString - owner: MyString - modified_by_client: MyString - modified_by_user: MyString + owner_uuid: MyString + modified_by_client_uuid: MyString + modified_by_user_uuid: MyString modified_at: 2013-06-27 11:45:37 name: MyString properties: MyText two: uuid: MyString - owner: MyString - modified_by_client: MyString - modified_by_user: MyString + owner_uuid: MyString + modified_by_client_uuid: MyString + modified_by_user_uuid: MyString modified_at: 2013-06-27 11:45:37 name: MyString properties: MyText diff --git a/services/api/test/fixtures/users.yml b/services/api/test/fixtures/users.yml index d39ebae65c..d124cec549 100644 --- a/services/api/test/fixtures/users.yml +++ b/services/api/test/fixtures/users.yml @@ -5,8 +5,8 @@ one: created_by_client: MyString created_by_user: MyString created_at: 2013-01-21 21:00:42 - modified_by_client: MyString - modified_by_user: MyString + modified_by_client_uuid: MyString + modified_by_user_uuid: MyString modified_at: 2013-01-21 21:00:42 email: MyString first_name: MyString @@ -20,8 +20,8 @@ two: created_by_client: MyString created_by_user: MyString created_at: 2013-01-21 21:00:42 - modified_by_client: MyString - modified_by_user: MyString + modified_by_client_uuid: MyString + modified_by_user_uuid: MyString modified_at: 2013-01-21 21:00:42 email: MyString first_name: MyString diff --git a/services/api/test/fixtures/virtual_machines.yml b/services/api/test/fixtures/virtual_machines.yml index 23b32c9407..03698cda9f 100644 --- a/services/api/test/fixtures/virtual_machines.yml +++ b/services/api/test/fixtures/virtual_machines.yml @@ -2,16 +2,16 @@ one: uuid: MyString - owner: MyString - modified_by_client: MyString - modified_by_user: MyString + owner_uuid: MyString + modified_by_client_uuid: MyString + modified_by_user_uuid: MyString modified_at: 2013-06-08 01:37:30 hostname: MyString two: uuid: MyString - owner: MyString - modified_by_client: MyString - modified_by_user: MyString + owner_uuid: MyString + modified_by_client_uuid: MyString + modified_by_user_uuid: MyString modified_at: 2013-06-08 01:37:30 hostname: MyString diff --git a/services/crunch/crunch-job b/services/crunch/crunch-job index 8c50ba6eaf..4ab942b487 100755 --- a/services/crunch/crunch-job +++ b/services/crunch/crunch-job @@ -130,8 +130,8 @@ if ($job_has_uuid) { $Job = $arv->{'jobs'}->{'get'}->execute('uuid' => $jobspec); if (!$force_unlock) { - if ($Job->{'is_locked_by'}) { - croak("Job is locked: " . $Job->{'is_locked_by'}); + if ($Job->{'is_locked_by_uuid'}) { + croak("Job is locked: " . $Job->{'is_locked_by_uuid'}); } if ($Job->{'success'} ne undef) { croak("Job 'success' flag (" . $Job->{'success'} . ") is not null"); @@ -154,7 +154,7 @@ else qw(script script_version script_parameters); } - $Job->{'is_locked_by'} = $User->{'uuid'}; + $Job->{'is_locked_by_uuid'} = $User->{'uuid'}; $Job->{'started_at'} = gmtime; $Job = $arv->{'jobs'}->{'create'}->execute('job' => $Job); @@ -251,7 +251,7 @@ if ($job_has_uuid) { # Claim this job, and make sure nobody else does - $Job->{'is_locked_by'} = $User->{'uuid'}; + $Job->{'is_locked_by_uuid'} = $User->{'uuid'}; $Job->{'started_at'} = gmtime; $Job->{'running'} = 1; $Job->{'success'} = undef; @@ -260,7 +260,7 @@ if ($job_has_uuid) 'running' => 0, 'done' => 0 }; if ($job_has_uuid) { - unless ($Job->save() && $Job->{'is_locked_by'} == $User->{'uuid'}) { + unless ($Job->save() && $Job->{'is_locked_by_uuid'} == $User->{'uuid'}) { croak("Error while updating / locking job"); } } @@ -829,7 +829,7 @@ sub reapchildren # Load new tasks my $newtask_list = $arv->{'job_tasks'}->{'list'}->execute( 'where' => { - 'created_by_job_task' => $Jobstep->{'arvados_task'}->{uuid} + 'created_by_job_task_uuid' => $Jobstep->{'arvados_task'}->{uuid} }, 'order' => 'qsequence' ); -- 2.30.2
<%= g.name %> - <%= g.owner %> + <%= g.owner_uuid %> <%= @links_to.select { |x| x.head_uuid == g.uuid }.collect(&:tail_uuid).uniq.count %> <%= @links_from.select { |x| x.tail_uuid == g.uuid }.collect(&:head_uuid).uniq.count %> - <%= @owned_users.select { |x| x.owner == g.uuid }.count %> users
+ <%= @owned_users.select { |x| x.owner_uuid == g.uuid }.count %> users
- <% if current_user and (current_user.is_admin or current_user.uuid == link.owner) %> + <% if current_user and (current_user.is_admin or current_user.uuid == link.owner_uuid) %> <%= link_to raw(''), { action: 'destroy', id: link.uuid }, { confirm: 'Delete this link?', method: 'delete' } %> <% end %> <%= link_to_if_arvados_object ob.pipeline_template_uuid %> - <%= link_to_if_arvados_object ob.owner %> + <%= link_to_if_arvados_object ob.owner_uuid %> <% ob.components.each do |cname, c| %> <% status = if !(c.is_a?(Hash) && c[:job].is_a?(Hash)) then nil elsif c[:job][:success] then 'success' elsif c[:job][:running] then 'info' else 'warning' end %> diff --git a/apps/workbench/app/views/pipeline_templates/index.html.erb b/apps/workbench/app/views/pipeline_templates/index.html.erb index 15caf7a3f5..18de526ae3 100644 --- a/apps/workbench/app/views/pipeline_templates/index.html.erb +++ b/apps/workbench/app/views/pipeline_templates/index.html.erb @@ -22,7 +22,7 @@ <%= ob.name %> - <%= link_to_if_arvados_object ob.owner %> + <%= link_to_if_arvados_object ob.owner_uuid %> <%= ob.components.collect { |k,v| k.to_s }.join(", ") %> <%= render_editable_attribute u, 'is_admin', u.is_admin ? 'Admin' : 'No', "data-type" => "select", "data-source" => '[{value:1,text:"admin"},{value:0,text:"No"}]', "data-value" => u.is_admin ? "1" : "0" %> - <%= render_editable_attribute u, 'owner' %> + <%= render_editable_attribute u, 'owner_uuid' %> <%= render_editable_attribute u, 'default_owner' %>