From: Tomas Sedovic <[email protected]>

Previously, it dispayed all available pools, providers and the links for
adding new ones with no regards to privileges.

Now, only the allowed things are displayed.
---
 src/app/controllers/dashboard_controller.rb |    2 --
 src/app/views/layouts/_main_nav.html.erb    |    8 ++++++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/app/controllers/dashboard_controller.rb 
b/src/app/controllers/dashboard_controller.rb
index 0a3e948..845901f 100644
--- a/src/app/controllers/dashboard_controller.rb
+++ b/src/app/controllers/dashboard_controller.rb
@@ -51,9 +51,7 @@ class DashboardController < ApplicationController
 
   def index
     # FIXME filter to just those that the user has access to
-    @providers = Provider.find(:all)
     @cloud_accounts = CloudAccount.find(:all)
-    @pools = Pool.find(:all)
 
     # FIXME remove general role based permission check, replace w/
     # more granular / per-permission-object permission checks on the
diff --git a/src/app/views/layouts/_main_nav.html.erb 
b/src/app/views/layouts/_main_nav.html.erb
index 6a970f6..8f4612a 100644
--- a/src/app/views/layouts/_main_nav.html.erb
+++ b/src/app/views/layouts/_main_nav.html.erb
@@ -18,7 +18,9 @@
   <% } %>
   <% end %>
 </ul>
-<%=link_to "Add a provider", {:controller => "provider", :action => "new"}, 
:class => "actionlink" %>
+<% if 
BasePermissionObject.general_permission_scope.has_privilege(@current_user, 
Privilege::PROVIDER_MODIFY) %>
+    <%= link_to "Add a provider", {:controller => "provider", :action => 
"new"}, :class => "actionlink" %>
+<% end %>
 <h3>Pools</h3>
 <ul id="pools">
   <% if [email protected]? %>
@@ -33,4 +35,6 @@
   <% } %>
   <% end %>
 </ul>
-<%=link_to "Add a pool", {:controller => "pool", :action => "new"}, :class => 
"actionlink" %>
+<% if 
BasePermissionObject.general_permission_scope.has_privilege(@current_user, 
Privilege::POOL_MODIFY) %>
+    <%= link_to "Add a pool", {:controller => "pool", :action => "new"}, 
:class => "actionlink" %>
+<% end %>
-- 
1.6.6.1

_______________________________________________
deltacloud-devel mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/deltacloud-devel

Reply via email to