configFactory = $config_factory; $this->account = $account; } /** * {@inheritdoc} */ public function addMessage($message, $op = NULL) { if (!isset($this->isVerbose)) { $config = $this->configFactory->get('pathauto.settings'); $this->isVerbose = $config->get('verbose') && $this->account->hasPermission('notify of path changes'); } if (!$this->isVerbose || (isset($op) && in_array($op, array('bulkupdate', 'return')))) { return FALSE; } if ($message) { drupal_set_message($message); } return TRUE; } }