You are here

function twitter_post_update_6200 in Twitter 6.5

Add the new "post to twitter with global account" permission to all roles that have the "post to twitter" permission.

File

twitter_post/twitter_post.install, line 26
Install, update and uninstall functions for the twitter module.

Code

function twitter_post_update_6200() {
  $result = db_query("SELECT rid\n    FROM {permission}\n    WHERE perm = 'post to twitter'");
  while ($row = db_fetch_object($result)) {
    $record = new StdClass();
    $record->rid = $row->rid;
    $record->perm = 'post to twitter with global account';
    $record->tid = 0;
    drupal_write_record('permission', $record);
  }
  drupal_set_message(t('A new permission "Post a message to Twitter using a global account" as been added to all roles that already had the "Post a message to Twitter" permission. It is recommended to <a href="@url">review the permissions</a> to ensure they are appropriate for this site\'s needs.', array(
    '@url' => url('admin/people/permissions'),
  )));
  return array();
}