You are here

function permissions_lock_form_validate in Permissions Lock 7

Custom validation handler to keep the locked permissions in their current state.

1 string reference to 'permissions_lock_form_validate'
permissions_lock_form_alter in ./permissions_lock.module
Implements hook_form_alter().

File

./permissions_lock.module, line 132
Lock permissions on the permissions administration pages for certain roles

Code

function permissions_lock_form_validate($form, &$form_state) {

  // get locked roles, to remove them from the form_state
  $locked_roles = permissions_lock_get_locked_roles();

  // for roles that are locked, we remove their entry in $form_state
  if (!empty($locked_roles)) {
    foreach ($locked_roles as $locked_rid) {
      unset($form_state['values']['role_names'][$locked_rid]);
    }
  }
}