access control
Spaces Integrating a CCK Field
grayside — Mon, 07/26/2010 - 12:25
I wanted to make a CCK Field available only when a given feature was enabled. It turns out it’s really easy.
CCK comes with a hook_field_access() hook (see content_access()). Any implementation of this function that returns FALSE for a given field results in that field being denied to the user.
By implementing this function with a Spaces API call instead of the content_permissions module approach of a new, field-specific permission, all kinds of magic becomes possible.
Read on for demonstration code.