[ARVADOS] updated: 2b43b263f8cd5cbd931d884bfa961a7dba7a4b9a

git at public.curoverse.com git at public.curoverse.com
Tue Oct 27 09:26:20 EDT 2015


Summary of changes:
 apps/workbench/app/models/group.rb                       |  4 ++++
 apps/workbench/app/models/keep_disk.rb                   |  2 +-
 apps/workbench/app/models/keep_service.rb                |  2 +-
 apps/workbench/app/models/link.rb                        |  4 ++++
 apps/workbench/app/models/node.rb                        |  2 +-
 apps/workbench/app/models/virtual_machine.rb             |  7 ++++++-
 .../test/integration/application_layout_test.rb          | 16 ++++++++--------
 7 files changed, 25 insertions(+), 12 deletions(-)

       via  2b43b263f8cd5cbd931d884bfa961a7dba7a4b9a (commit)
      from  9379a6ccce1d9787ced772e82732f1d5de8bc756 (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 2b43b263f8cd5cbd931d884bfa961a7dba7a4b9a
Author: radhika <radhika at curoverse.com>
Date:   Tue Oct 27 09:23:24 2015 -0400

    7453: do not display generic "add new" button in the groups, keep_disks, keep_services, links, nodes, and virtual_machines listing pages.

diff --git a/apps/workbench/app/models/group.rb b/apps/workbench/app/models/group.rb
index 3f5da15..0d35860 100644
--- a/apps/workbench/app/models/group.rb
+++ b/apps/workbench/app/models/group.rb
@@ -32,4 +32,8 @@ class Group < ArvadosBase
   def textile_attributes
     [ 'description' ]
   end
+
+  def self.creatable?
+    false
+  end
 end
diff --git a/apps/workbench/app/models/keep_disk.rb b/apps/workbench/app/models/keep_disk.rb
index 8ced4eb..6438fc7 100644
--- a/apps/workbench/app/models/keep_disk.rb
+++ b/apps/workbench/app/models/keep_disk.rb
@@ -1,5 +1,5 @@
 class KeepDisk < ArvadosBase
   def self.creatable?
-    current_user and current_user.is_admin
+    false
   end
 end
diff --git a/apps/workbench/app/models/keep_service.rb b/apps/workbench/app/models/keep_service.rb
index f27e369..0c998c4 100644
--- a/apps/workbench/app/models/keep_service.rb
+++ b/apps/workbench/app/models/keep_service.rb
@@ -1,5 +1,5 @@
 class KeepService < ArvadosBase
   def self.creatable?
-    current_user and current_user.is_admin
+    false
   end
 end
diff --git a/apps/workbench/app/models/link.rb b/apps/workbench/app/models/link.rb
index 271fa0f..b1bbcff 100644
--- a/apps/workbench/app/models/link.rb
+++ b/apps/workbench/app/models/link.rb
@@ -18,4 +18,8 @@ class Link < ArvadosBase
     result = arvados_api_client.api("permissions", "/#{uuid}")
     arvados_api_client.unpack_api_response(result)
   end
+
+  def self.creatable?
+    false
+  end
 end
diff --git a/apps/workbench/app/models/node.rb b/apps/workbench/app/models/node.rb
index e66be83..8bf98c6 100644
--- a/apps/workbench/app/models/node.rb
+++ b/apps/workbench/app/models/node.rb
@@ -1,6 +1,6 @@
 class Node < ArvadosBase
   def self.creatable?
-    current_user and current_user.is_admin
+    false
   end
   def friendly_link_name lookup=nil
     (hostname && !hostname.empty?) ? hostname : uuid
diff --git a/apps/workbench/app/models/virtual_machine.rb b/apps/workbench/app/models/virtual_machine.rb
index 3b44397..e1a208c 100644
--- a/apps/workbench/app/models/virtual_machine.rb
+++ b/apps/workbench/app/models/virtual_machine.rb
@@ -1,20 +1,25 @@
 class VirtualMachine < ArvadosBase
   attr_accessor :current_user_logins
+
   def self.creatable?
-    current_user.andand.is_admin
+    false
   end
+
   def attributes_for_display
     super.append ['current_user_logins', @current_user_logins]
   end
+
   def editable_attributes
     super - %w(current_user_logins)
   end
+
   def self.attribute_info
     merger = ->(k,a,b) { a.merge(b, &merger) }
     merger [nil,
             {current_user_logins: {column_heading: "logins", type: 'array'}},
             super]
   end
+
   def friendly_link_name lookup=nil
     (hostname && !hostname.empty?) ? hostname : uuid
   end
diff --git a/apps/workbench/test/integration/application_layout_test.rb b/apps/workbench/test/integration/application_layout_test.rb
index 61ba162..db072e4 100644
--- a/apps/workbench/test/integration/application_layout_test.rb
+++ b/apps/workbench/test/integration/application_layout_test.rb
@@ -218,14 +218,14 @@ class ApplicationLayoutTest < ActionDispatch::IntegrationTest
   end
 
    [
-    ['Repositories',nil,'s0uqq'],
-    ['Virtual machines','virtual machine','current_user_logins'],
-    ['SSH keys',nil,'public_key'],
-    ['Links','link','link_class'],
-    ['Groups','group','group_class'],
-    ['Compute nodes','node','info[ping_secret'],
-    ['Keep services','keep service','service_ssl_flag'],
-    ['Keep disks', 'keep disk','bytes_free'],
+    ['Repositories', nil, 's0uqq'],
+    ['Virtual machines', nil, 'testvm.shell'],
+    ['SSH keys', nil, 'public_key'],
+    ['Links', nil, 'link_class'],
+    ['Groups', nil, 'All users'],
+    ['Compute nodes', nil, 'ping_secret'],
+    ['Keep services', nil, 'service_ssl_flag'],
+    ['Keep disks', nil, 'bytes_free'],
   ].each do |page_name, add_button_text, look_for|
     test "test system menu #{page_name} link" do
       visit page_with_token('admin')

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list