As far as we use dynamic list of fields in every specific case, we've reworked existing rest framework metadata mechanism (OPTIONS requests). By default only editable fields are shown here, so for clear understanding of current situation, viewable fields were added inside GET action (unicef_restlib.metadata.CRUActionsMetadataMixin). When fields lists are prepared, they can be filtered using permissions with etools.applications.utils.permissions.metadata.PermissionsBasedMetadataMixin. Also, transitions set can vary depending on the permissions, so they also should be available in the metadata. etools.applications.permissions2.PermittedFSMTransitionActionMetadataMixin was designed to do this. Additionally, transitions can be renamed on the fly using name in custom attribute of transition. For example:
If none is provided, function name will be used as the display name in the metadata.
So here is an example of the metadata class that can correctly communicate with permissions and correctly display information about the availability of each field.