6

I notice we can define a custom php list for options widget in CCK.

Would love to limit allowed values per role?

What would be the easiest way?

Such a solution could replace a lot of other modules, like Workflow etc...

2

You dont need a module, this is in core.

  $values = array(1|one, 2|two, 3|three);

  global $user;

  // Check to see if $user has the administrator role.
  if (in_array('administrator', array_values($user->roles))) {
    $values[] = 'special|special';
  }
  return $values;

limiting allowed values with php

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.