[ARVADOS] updated: 5e120ff28f90ff5ca4b3cf0d36e5c338a4be12f7

git at public.curoverse.com git at public.curoverse.com
Fri Jun 13 16:22:15 EDT 2014


Summary of changes:
 apps/workbench/app/controllers/collections_controller.rb | 2 --
 apps/workbench/app/models/arvados_base.rb                | 2 +-
 services/api/app/models/user.rb                          | 6 +++++-
 3 files changed, 6 insertions(+), 4 deletions(-)

       via  5e120ff28f90ff5ca4b3cf0d36e5c338a4be12f7 (commit)
      from  8e6ea9f0058ba3809d926ac9e704390d95a58514 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 5e120ff28f90ff5ca4b3cf0d36e5c338a4be12f7
Author: radhika <radhika at curoverse.com>
Date:   Fri Jun 13 16:21:28 2014 -0400

    2659: add anonymous group to readable groups

diff --git a/apps/workbench/app/controllers/collections_controller.rb b/apps/workbench/app/controllers/collections_controller.rb
index f0eea06..6a5df87 100644
--- a/apps/workbench/app/controllers/collections_controller.rb
+++ b/apps/workbench/app/controllers/collections_controller.rb
@@ -187,7 +187,6 @@ class CollectionsController < ApplicationController
 
   def share
     a = ApiClientAuthorization.create(scopes: sharing_scopes)
-    share_with_anonymous_group @object.uuid
     @search_sharing = search_scopes
     render 'sharing_popup'
   end
@@ -198,7 +197,6 @@ class CollectionsController < ApplicationController
       s.destroy
     end
     @search_sharing = search_scopes
-    unshare_with_anonymous_group @object.uuid
     render 'sharing_popup'
   end
 
diff --git a/apps/workbench/app/models/arvados_base.rb b/apps/workbench/app/models/arvados_base.rb
index 33e107e..f9c364d 100644
--- a/apps/workbench/app/models/arvados_base.rb
+++ b/apps/workbench/app/models/arvados_base.rb
@@ -291,7 +291,7 @@ class ArvadosBase < ActiveRecord::Base
   end
 
   def self.creatable?
-    current_user
+    current_user && (!current_user[:uuid].ends_with?('anonymouspublic'))
   end
 
   def self.goes_in_folders?
diff --git a/services/api/app/models/user.rb b/services/api/app/models/user.rb
index 52dd8d7..677685d 100644
--- a/services/api/app/models/user.rb
+++ b/services/api/app/models/user.rb
@@ -41,7 +41,11 @@ class User < ArvadosModel
   end
 
   def groups_i_can(verb)
-    self.group_permissions.select { |uuid, mask| mask[verb] }.keys
+    my_groups = self.group_permissions.select { |uuid, mask| mask[verb] }.keys
+    if verb == :read
+      my_groups << anonymous_group_uuid
+    end
+    my_groups
   end
 
   def can?(actions)

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list