[openstack-dev] [Horizon] Making table info display the same for admin and non-admin users

Dale, StewartX T stewartx.t.dale at intel.com
Thu Dec 6 16:40:48 UTC 2012


Hi All,

 I have been making some changes to some of the horizon dashboard pages to show more info in the tables that are displayed (namely nova->instances, syspanel->instances, syspanel->flavors).   This mainly involved adding some addition columns to the tables being rendered (one was a host column which shows which host the instance is running on).  One thing I noticed is when I am logged is a non-admin user instead of showing me the host name it displays a "-" instead.  I am assuming this has something to do with permission issues but after reviewing the code in horizon/dashboards/nova/instances/tables.py & views.py I don't see anything in there that is checking for if a user is admin or not.  Here is the code I am using to add the extra columns:

nova/instances/tables.py:

class InstancesTable(tables.DataTable):
    [cut]
    host = tables.Column("OS-EXT-SRV-ATTR:host",
                         verbose_name=_("Host"),
                         classes=('nowrap-col',))

    trust_lvl = tables.Column(get_trust_state,
                         verbose_name=_("Trust Level"),
                         classes=('nowrap-col',))

Hopefully someone can point me in the right direction.

-Stewart Dale

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20121206/a192d82b/attachment.html>


More information about the OpenStack-dev mailing list