[Cubicweb] Retrieve CWUser attributes in a view

St├ęphane Bugat stephane.bugat at free.fr
Tue Jul 3 14:06:12 CEST 2012

Dear all,

In my CW project, I want to associate to any user the possibility to display or hide some entity attributes in the current entity view. To be more specific, I have an Airport entity type with a "fuel type" attribute, but not all users are interested to view the available fuel types.

For that, I just need to build a specific "user preferences" entity with booleans attributes for the display/hide of Airport attributes, and associate this entity with CWUser using an inline relation.

For the second part, that is the effective display or not of the attributes in a specific Airport view, I don't know how to proceed: how can I retrieve these booleans associated to the current CWUser in my EntityView? I guess there is a way to get them through self._cw but I don't know how.

Hope this is clear for all of you - if not just let me know.

Best regards 


More information about the Cubicweb mailing list