This happened if you were not a site admin because we do
not have perms hooked directly to instances, but pools.
---
src/app/models/instance.rb | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/src/app/models/instance.rb b/src/app/models/instance.rb
index 591bc62..ee35ba5 100644
--- a/src/app/models/instance.rb
+++ b/src/app/models/instance.rb
@@ -171,7 +171,10 @@ class Instance < ActiveRecord::Base
:stopped_instances => 0,
}
- instances = Instance.with_hardware_profile.list_for_user(user,
Privilege::INSTANCE_VIEW)
+ instances = []
+ pools = Pool.list_for_user(user, Privilege::INSTANCE_VIEW)
+ pools.each{|pool| pool.instances.each {|i| instances << i}}
+ #instances = Instance.with_hardware_profile.list_for_user(user,
Privilege::INSTANCE_VIEW)
instances.each do |i|
if i.state == Instance::STATE_RUNNING
stats[:running_instances] += 1
--
1.6.2.5
_______________________________________________
deltacloud-devel mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/deltacloud-devel