Cloned from launchpad blueprint https://blueprints.launchpad.net/horizon/+spec/datatable-column-level-permissions.
Add Column-level permissions to DataTable.
The need arised when implementing blueprint trove-list-datastores-and-versions.
The table which displays datastores versions must include columns for admins.
Regular users must see only "name" and "ID" whereas an admin will sees
"name", "ID", "active", "packages" and "image ID".
Be able to filter DataTable's columns depending user permissions.
Thus we can easily display admin only columns.
This is *not only* about hiding columns.
For instance, some data are not available to regular users in API responses.
So when a user does not have the permissions we must ignore the columns as if
they were not defined.
column = tables.Column(...)
admin_only_column = tables.Column(...,
Only a admin would see the second column.
Regular users would see only the first.
See the following files in https://review.openstack.org/#/c/163196/:
* DataTable patch: horizon/tables/base.py
* Usage: database_datastores/tables.py
When a DataTable is rendered to a user who has not the permissions to view a
column, we must ensure that:
* The column is not showed
* The column data is not processed
Requirements Update Required
Document how to filter DataTable columns thanks to the new argument:
Specification URL (additional information):