[ARVADOS] created: 1.3.0-3125-g3c893d29a

Git user git at public.arvados.org
Thu Sep 10 21:43:52 UTC 2020


        at  3c893d29ad7a9acda0c25b47fd0c9ba5a4a5193a (commit)


commit 3c893d29ad7a9acda0c25b47fd0c9ba5a4a5193a
Author: Peter Amstutz <peter.amstutz at curii.com>
Date:   Thu Sep 10 17:41:54 2020 -0400

    16811: Make public favorites work
    
    Update API docs.
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>

diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb
index 77ec68bdb..c626e97f1 100644
--- a/apps/workbench/app/controllers/application_controller.rb
+++ b/apps/workbench/app/controllers/application_controller.rb
@@ -927,7 +927,7 @@ class ApplicationController < ActionController::Base
   helper_method :my_starred_projects
   def my_starred_projects user
     return if defined?(@starred_projects) && @starred_projects
-    links = Link.filter([['owner_uuid', 'in', ["#{Rails.configuration.ClusterID}-j7d0g-fffffffffffffff", user.uuid]],
+    links = Link.filter([['tail_uuid', 'in', ["#{Rails.configuration.ClusterID}-j7d0g-fffffffffffffff", user.uuid]],
                          ['link_class', '=', 'star'],
                          ['head_uuid', 'is_a', 'arvados#group']]).with_count("none").select(%w(head_uuid))
     uuids = links.collect { |x| x.head_uuid }
diff --git a/doc/api/methods/links.html.textile.liquid b/doc/api/methods/links.html.textile.liquid
index 2e5de1856..98ff23ffb 100644
--- a/doc/api/methods/links.html.textile.liquid
+++ b/doc/api/methods/links.html.textile.liquid
@@ -43,28 +43,35 @@ h3. star
 
 A **star** link is a shortcut to a project that is displayed in the user interface (Workbench) as "favorites".  Users can mark their own favorites (implemented by creating or deleting **star** links).
 
-An admin can also create **star** links owned by the "All Users" group, these will be displayed to all users that have permission to read the project that has been favorited.
+An admin can also create **star** links owned by the system user, with @tail_uuid@ as the "All Users" group.  These are "public favorites" that will be displayed to all users that have permission to read the project that has been favorited.  Note: setting a public favorite also requires creating a @can_read@ permission link from @All Users@ to the 'star' link record.
 
 The schema for a star link is:
 
 table(table table-bordered table-condensed).
 |_. Field|_. Value|_. Description|
-|owner_uuid|user or group uuid|Either the user that owns the favorite, or the "All Users" group for public favorites.|
+|tail_uuid|user or group uuid|Either the user that owns the favorite, or the "All Users" group for public favorites.|
 |head_uuid|project uuid|The project being favorited|
 |link_class|string of value "star"|Indicates this represents a link to a user favorite|
 
-h4. Creating a favorite
+h4. Creating a public favorite
 
- at owner_uuid@ is either an individual user, or the "All Users" group.  The @head_uuid@ is the project being favorited.
+ at tail_uuid@ is either an individual user, or the "All Users" group.  The @head_uuid@ is the project being favorited.
 
 <pre>
+$ linkuuid=$(arv --format=uuid link create --link '{
+    "link_class": "star",
+    "owner_uuid": "zzzzz-tpzed-000000000000000",
+    "tail_uuid": "zzzzz-j7d0g-fffffffffffffff",
+    "head_uuid":  "zzzzz-j7d0g-theprojectuuid"}')
+
 $ arv link create --link '{
-    "owner_uuid": "zzzzz-j7d0g-fffffffffffffff",
-    "head_uuid":  "zzzzz-j7d0g-theprojectuuid",
-    "link_class": "star"}'
+    "link_class": "permission",
+    "name": "can_read",
+    "tail_uuid": "zzzzz-j7d0g-fffffffffffffff",
+    "head_uuid":  "zzzzz-o0j2j-'$linkuuid'"}'
 </pre>
 
-h4. Deleting a favorite
+h4. Removing a favorite
 
 <pre>
 $ arv link delete --uuid zzzzz-o0j2j-thestarlinkuuid
@@ -77,7 +84,7 @@ To list all 'star' links that will be displayed for a user:
 <pre>
 $ arv link list --filters '[
   ["link_class", "=", "star"],
-  ["owner_uuid", "in", ["zzzzz-j7d0g-fffffffffffffff", "zzzzz-tpzed-currentuseruuid"]]]'
+  ["tail_uuid", "in", ["zzzzz-j7d0g-fffffffffffffff", "zzzzz-tpzed-currentuseruuid"]]]'
 </pre>
 
 h3. tag

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list