Кнопка добавления в корзину только для авторизованных пользователей в E-commerce Drupal 7
Как сделать так чтобы кнопка добавления в корзину была доступна только для авторизованных...
name: My module type: module description: 'This is my module for Drupal 8.' package: Custom version: 8.x-1.0 core: 8.x dependencies: - node - block hidden: false
namespace Drupal\my_module\Controller; use Drupal\Core\Controller\ControllerInterface; use Symfony\Component\DependencyInjection\ContainerInterface; class MyModuleController implements ControllerInterface { public static function create(ContainerInterface $container) { return new static($container->get('module_handler')); } public function my_modulePage() { return array( '#markup' => t('This is the demo page.'), ); } }
my_module: pattern: 'admin/my_module' defaults: _content: '\Drupal\my_module\Controller\MyModuleController::my_modulePage' requirements: _permission: 'access administration pages'
/** * Implements hook_menu(). */ function my_module_menu() { $items['admin/my_module'] = array( 'title' => 'My first Module', 'description' => 'This is the demo page.', 'route_name' => 'my_module', ); return $items; }