14874: Renames DefaultProperties to ManagedProperties. Fixes documentation.
authorLucas Di Pentima <ldipentima@veritasgenetics.com>
Wed, 19 Jun 2019 20:28:44 +0000 (17:28 -0300)
committerLucas Di Pentima <ldipentima@veritasgenetics.com>
Wed, 19 Jun 2019 20:28:44 +0000 (17:28 -0300)
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima@veritasgenetics.com>

doc/_config.yml
doc/admin/collection-default-properties.html.textile.liquid [deleted file]
doc/admin/collection-managed-properties.html.textile.liquid [new file with mode: 0644]
lib/config/config.default.yml
lib/config/generated_config.go
services/api/app/models/collection.rb
services/api/config/arvados_config.rb
services/api/test/unit/collection_test.rb

index 2d42e0dc423debd7ccc7557e8dd0a604e78ac076..959a3624b58b43f4ecd9b2f9fb6dd0b99d9e2b64 100644 (file)
@@ -180,7 +180,7 @@ navbar:
       - admin/spot-instances.html.textile.liquid
     - Data Management:
       - admin/collection-versioning.html.textile.liquid
-      - admin/collection-default-properties.html.textile.liquid
+      - admin/collection-managed-properties.html.textile.liquid
     - Other:
       - admin/federation.html.textile.liquid
       - admin/controlling-container-reuse.html.textile.liquid
diff --git a/doc/admin/collection-default-properties.html.textile.liquid b/doc/admin/collection-default-properties.html.textile.liquid
deleted file mode 100644 (file)
index 63fe842..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
----
-layout: default
-navsection: admin
-title: Configuring collection's default properties
-...
-
-{% comment %}
-Copyright (C) The Arvados Authors. All rights reserved.
-
-SPDX-License-Identifier: CC-BY-SA-3.0
-{% endcomment %}
-
-Collection's default properties allow a cluster administrator to enable some special behaviors regarding properties at creation & update times.
-This page describes how to enable and configure these behaviors on the API server.
-
-h3. API Server configuration
-
-The @collection_default_properties@ setting is used for enabling any of the following behaviors:
-
-h4. Pre-assigned property key & value
-
-For every newly created collection, assign a predefined key/value pair if it isn't already passed at creation time:
-
-<pre>
-collection_default_properties:
-  foo: {value: bar}
-</pre>
-
-h4. Original owner UUID
-
-This behavior will assign to a property key the UUID of the user who owns the collection's contaning project.
-
-<pre>
-collection_default_properties:
-  responsible_person_uuid: {function: original_owner}
-</pre>
-
-h4. Protected properties
-
-If there's a need to avoid a non-admin user to modify a specific property, even by its owner, the @protected@ attribute can be set to true, like so:
-
-<pre>
-collection_default_properties:
-  responsible_person_uuid: {function: original_owner, protected: true}
-</pre>
-
-This property can be applied to any of the defined default properties. If missing, it's assumed as being @false@ by default.
\ No newline at end of file
diff --git a/doc/admin/collection-managed-properties.html.textile.liquid b/doc/admin/collection-managed-properties.html.textile.liquid
new file mode 100644 (file)
index 0000000..611a11e
--- /dev/null
@@ -0,0 +1,50 @@
+---
+layout: default
+navsection: admin
+title: Configuring collection's managed properties
+...
+
+{% comment %}
+Copyright (C) The Arvados Authors. All rights reserved.
+
+SPDX-License-Identifier: CC-BY-SA-3.0
+{% endcomment %}
+
+Collection's managed properties allow a cluster administrator to enable some special behaviors regarding properties at creation & update times.
+This page describes how to enable and configure these behaviors on the API server.
+
+h3. API Server configuration
+
+The @Collections.ManagedProperties@ setting from the @config.yml@ file is used for enabling any of the following behaviors:
+
+h4. Pre-assigned property key & value
+
+For every newly created collection, assign a predefined key/value pair if it isn't already passed at creation time:
+
+<pre>
+Collections:
+  ManagedProperties:
+    foo: {value: bar}
+</pre>
+
+h4. Original owner UUID
+
+This behavior will assign to a property key the UUID of the user who owns the collection's contaning project.
+
+<pre>
+Collections:
+  ManagedProperties:
+    responsible_person_uuid: {function: original_owner}
+</pre>
+
+h4. Protected properties
+
+If there's a need to prevent a non-admin user from modifying a specific property, even by its owner, the @protected@ attribute can be set to @true@, like so:
+
+<pre>
+Collections:
+  ManagedProperties:
+    responsible_person_uuid: {function: original_owner, protected: true}
+</pre>
+
+This property can be applied to any of the defined managed properties. If missing, it's assumed as being @false@ by default.
\ No newline at end of file
index 3a9beee253527201300357785d95f7fb418732dc..1c4542e45bbf47a9b8fb4fd5ebe213d8c9fcb338 100644 (file)
@@ -274,7 +274,7 @@ Clusters:
       # > 0 = auto-create a new version when older than the specified number of seconds.
       PreserveVersionIfIdle: -1
 
-      # Default collection properties. At creation time, if the client didn't
+      # Managed collection properties. At creation time, if the client didn't
       # provide the listed keys, they will be automatically populated following
       # one of the following behaviors:
       #
@@ -285,7 +285,7 @@ Clusters:
       #   foo_bar: {value: baz, protected: false}
       #
       # If protected is true, only an admin user can modify its value.
-      DefaultProperties: {}
+      ManagedProperties: {}
 
     Login:
       # These settings are provided by your OAuth2 provider (e.g.,
index f4df11a6b279e797723c38d701f3c79836f40b65..ede9f49532310612ebd571edacadab6c96524d69 100644 (file)
@@ -280,7 +280,7 @@ Clusters:
       # > 0 = auto-create a new version when older than the specified number of seconds.
       PreserveVersionIfIdle: -1
 
-      # Default collection properties. At creation time, if the client didn't
+      # Managed collection properties. At creation time, if the client didn't
       # provide the listed keys, they will be automatically populated following
       # one of the following behaviors:
       #
@@ -291,7 +291,7 @@ Clusters:
       #   foo_bar: {value: baz, protected: false}
       #
       # If protected is true, only an admin user can modify its value.
-      DefaultProperties: {}
+      ManagedProperties: {}
 
     Login:
       # These settings are provided by your OAuth2 provider (e.g.,
index c92b9451665d62ad8b4f4fb179720533f7f1946c..1ffaa6a319c449a4d2f65980a0848a035b8ffc86 100644 (file)
@@ -610,7 +610,7 @@ class Collection < ArvadosModel
 
   # Sets default properties at creation time
   def default_properties
-    default_props = Rails.configuration.Collections.DefaultProperties.with_indifferent_access
+    default_props = Rails.configuration.Collections.ManagedProperties.with_indifferent_access
     if default_props.empty?
       return
     end
@@ -687,12 +687,12 @@ class Collection < ArvadosModel
   end
 
   def protected_default_properties_updates
-    default_properties = Rails.configuration.Collections.DefaultProperties.with_indifferent_access
+    default_properties = Rails.configuration.Collections.ManagedProperties.with_indifferent_access
     if default_properties.empty? || !properties_changed? || current_user.is_admin
       return true
     end
     protected_props = default_properties.keys.select do |p|
-      Rails.configuration.Collections.DefaultProperties[p]['protected']
+      Rails.configuration.Collections.ManagedProperties[p]['protected']
     end
     # Pre-existent protected properties can't be updated
     invalid_updates = properties_was.keys.select{|p| properties_was[p] != properties[p]} & protected_props
index deaf165575858222c9cbc760133c395973eae234..22a8fed58e2fc584333f5f3684e822a7a20ac21c 100644 (file)
@@ -107,7 +107,6 @@ arvcfg.declare_config "AuditLogs.MaxAge", ActiveSupport::Duration, :max_audit_lo
 arvcfg.declare_config "AuditLogs.MaxDeleteBatch", Integer, :max_audit_log_delete_batch
 arvcfg.declare_config "AuditLogs.UnloggedAttributes", Array, :unlogged_attributes
 arvcfg.declare_config "SystemLogs.MaxRequestLogParamsSize", Integer, :max_request_log_params_size
-arvcfg.declare_config "Collections.DefaultProperties", Hash, :collection_default_properties
 arvcfg.declare_config "Collections.DefaultReplication", Integer, :default_collection_replication
 arvcfg.declare_config "Collections.DefaultTrashLifetime", ActiveSupport::Duration, :default_trash_lifetime
 arvcfg.declare_config "Collections.CollectionVersioning", Boolean, :collection_versioning
index be4df9c346cf78de9af1ad3bc719111210627221..4790501ddd5aaa875f5c716d88b9ac0464cec607 100644 (file)
@@ -1014,7 +1014,7 @@ class CollectionTest < ActiveSupport::TestCase
   end
 
   test "create collections with default properties" do
-    Rails.configuration.Collections.DefaultProperties = {
+    Rails.configuration.Collections.ManagedProperties = {
       'default_prop1' => {'value' => 'prop1_value'},
       'responsible_person_uuid' => {'function' => 'original_owner'}
     }
@@ -1046,7 +1046,7 @@ class CollectionTest < ActiveSupport::TestCase
   end
 
   test "update collection with protected default properties" do
-    Rails.configuration.Collections.DefaultProperties = {
+    Rails.configuration.Collections.ManagedProperties = {
       'default_prop1' => {'value' => 'prop1_value', 'protected' => true},
     }
     act_as_user users(:active) do