You are here

message_ui_test.module in Message UI 8

Dummy module for for testing how other modules will interact with message UI.

File

modules/message_ui_test/message_ui_test.module
View source
<?php

/**
 * @file
 * Dummy module for for testing how other modules will interact with message UI.
 */
use Drupal\Core\Access\AccessResult;
use Drupal\Core\Session\AccountInterface;
use Drupal\message\MessageInterface;

/**
 * Implements hook_message_message_ui_access_control().
 */
function message_ui_test_message_message_ui_access_control(MessageInterface $message, $op, AccountInterface $account) {
  return AccessResult::allowedIf($message->{$op});
}

/**
 * Implements hook_message_message_ui_create_access_control().
 */
function message_ui_test_message_message_ui_create_access_control($template, AccountInterface $account) {

  // The tests expect an allowed result when creating.
  return AccessResult::allowed();
}

Functions

Namesort descending Description
message_ui_test_message_message_ui_access_control Implements hook_message_message_ui_access_control().
message_ui_test_message_message_ui_create_access_control Implements hook_message_message_ui_create_access_control().