diff --git a/src/sunstone/etc/sunstone-views.yaml b/src/sunstone/etc/sunstone-views.yaml index 3bec9f4637..154746d545 100644 --- a/src/sunstone/etc/sunstone-views.yaml +++ b/src/sunstone/etc/sunstone-views.yaml @@ -11,3 +11,6 @@ groups: - cloud_vcenter default: - cloud +default_groupadmin: + - groupadmin + - cloud diff --git a/src/sunstone/models/SunstoneViews.rb b/src/sunstone/models/SunstoneViews.rb index c81a756e9a..585b165d46 100644 --- a/src/sunstone/models/SunstoneViews.rb +++ b/src/sunstone/models/SunstoneViews.rb @@ -110,6 +110,16 @@ class SunstoneViews end available << @views_config['default'] + group = OpenNebula::Group.new_with_id(user.gid, onec) + + rc = group.info + if !OpenNebula.is_error?(rc) + gadmins = group.admin_ids + if gadmins && gadmins.include?(user.id) + available << @views_config['default_groupadmin'] + end + end + available.flatten! available.reject!{|v| !@views.has_key?(v)} #sanitize array views