function contact_update_7002

Enable the 'access user contact forms' for registered users by default.

Related topics

File

drupal/modules/contact/contact.install, line 136
Install, update and uninstall functions for the contact module.

Code

function contact_update_7002() {

  // Do not use user_role_grant_permission() since it relies on
  // hook_permission(), which will not run for contact module if it is
  // disabled.
  db_merge('role_permission')
    ->key(array(
    'rid' => DRUPAL_AUTHENTICATED_RID,
    'permission' => 'access user contact forms',
    'module' => 'contact',
  ))
    ->execute();
}