function drush_policy_updatedb_validate

8.0.x policy.drush.inc drush_policy_updatedb_validate()
6.x policy.drush.inc drush_policy_updatedb_validate()
7.x policy.drush.inc drush_policy_updatedb_validate()
4.x policy.drush.inc drush_policy_updatedb_validate()
5.x policy.drush.inc drush_policy_updatedb_validate()

Implements drush_hook_COMMAND_validate().

To test this example without copying, execute `drush --include=./examples updatedb` from within your drush directory.

Unauthorized users may view pending updates but not execute them.

File

examples/policy.drush.inc, line 95
Example policy commandfile. Modify as desired.

Code

function drush_policy_updatedb_validate() {
  // Check for a token in the request. In this case, we require --token=secret.
  if (!drush_get_option('token') == 'secret') {
    drush_log(dt('Per site policy, you must add a secret --token complete this command. See examples/policy.drush.inc.  If you are running a version of drush prior to 4.3 and are not sure why you are seeing this message, please see http://drupal.org/node/1024824.'), 'warning');
    drush_set_context('DRUSH_AFFIRMATIVE', FALSE);
    drush_set_context('DRUSH_NEGATIVE', TRUE);
  }
}