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

Vishvananda Ishaya vishvananda at gmail.com
Mon Dec 10 18:36:24 UTC 2012


From nova/policy.json:

39     "compute_extension:extended_server_attributes": "rule:admin_api",

only admins are able to see the extended attributes by default. If you want regular users to be able to see the host you will have to change that to "".

Alternatively, the hostId field (which is a tenant specific sanitized hash of the host name) can be displayed to non-admins if you wish.

Vish

On Dec 6, 2012, at 8:40 AM, "Dale, StewartX T" <stewartx.t.dale at intel.com> wrote:

> 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
>  
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

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


More information about the OpenStack-dev mailing list