Commit 4432bb7e authored by catch's avatar catch

Issue #2062023 by rhm50, InternetDevels: Replace user_access() calls with...

Issue #2062023 by rhm50, InternetDevels: Replace user_access() calls with $account->hasPermission() in statistics module.
parent 2eccba71
......@@ -57,7 +57,7 @@ public function defaultConfiguration() {
* Overrides \Drupal\block\BlockBase::access().
*/
public function access() {
if (user_access('access content')) {
if (\Drupal::currentUser()->hasPermission('access content')) {
$daytop = $this->configuration['top_day_num'];
if (!$daytop || !($result = statistics_title_list('daycount', $daytop)) || !($this->day_list = node_title_list($result, t("Today's:")))) {
return FALSE;
......
......@@ -58,7 +58,7 @@ function statistics_node_view(EntityInterface $node, EntityDisplay $display, $vi
}
if ($view_mode != 'rss') {
if (user_access('view post access counter')) {
if (Drupal::currentUser()->hasPermission('view post access counter')) {
$statistics = statistics_get($node->id());
if ($statistics) {
$links['statistics_counter']['title'] = format_plural($statistics['totalcount'], '1 view', '@count views');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment