I need a hook (or something similar) where I can set the number of image uploads depending of the role of the user.
In the settings of the field there is no way to set the maximum number of values users can enter, just one value for all roles. For example, for role #1 I want the users can upload just 3 images, for role #2 just 5 images.
I tried several ways but none worked. I tried using #element_validate but the validation never worked.
Is there some way to do that? I forgot to mention is for Drupal 7.