Sử dụng hook_menu() với hook_permission()

Sử dụng hook_menu() với hook_permission()

Can someone see anything wrong with this hook_menu() and hook_permission() code? I am able to see the permissions in the admin menu, admin/people/permissions. I allow access tolos user front for authenticated users and save the settings. Then, I clear all caches and try to access los/register. I am getting You are not authorized to access this page. when I try with either administrative or authenticated users. I have cleared the cache, logged in and out and even closed the browser and restarted it refreshing ever step of the way.

/**
 * Implements hook_permission
 */
function los_permission() {
  return array(
    'los user front' => array(
      'title' => t('LOS User Frontend'),
      'description' => t('Access to LOS user frontend.'),
    ),
    'los user back' => array(
      'title' => t('LOS User Backend'),
      'description' => t('Access to LOS user backend'),
    ),
    'los admin back' => array(
      'title' => t('LOS Administration Backend'),
      'description' => t('Access to LOS administration backend.'),
    ),
  );
}

/**
 * Implements hook_menu
 */
function los_menu() {
  $items = array();

  $items['los/register'] = array(
    'title' => 'LOS Register',
    'description' => 'Large order system registration page',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('los_register'),
    'access arguments' => array('los user front'),
  );

  //... more $items here ...

  return $items;
}

 

Bạn thấy bài viết này như thế nào?: 
Average: 5 (1 vote)
Ảnh của Khanh Hoang

Khanh Hoang - Kenn

Kenn is a user experience designer and front end developer who enjoys creating beautiful and usable web and mobile experiences.

Tìm kiếm bất động sản

 

Advertisement

 

jobsora

Dich vu khu trung tphcm

Dich vu diet chuot tphcm

Dich vu diet con trung

Quảng Cáo Bài Viết

 
Thực hành Drupal 8 Theming Fundamentals phần 2

Thực hành Drupal 8 Theming Fundamentals phần 2

In our last post on Drupal 8 theming fundamentals, we learned to set up a theme and add our CSS and JavaScript.

Google, Apple, Facebook: Việc làm mơ ước của những người trẻ

Google, Apple, Facebook: Việc làm mơ ước của những người trẻ

Một cuộc khảo sát về nghề nghiệp của những người Mỹ trẻ vừa được công bố. Theo đó, 3 công ty nổi tiếng: Google, Apple và Facebook là miền đất hứa mơ ước của những người lao động này.

Gia đình miền Tây huyện Thới Bình hơn 20 năm chăm sóc hàng nghìn chim trời

Gia đình miền Tây huyện Thới Bình hơn 20 năm chăm sóc hàng nghìn chim trời

Anh Trương Minh Thắng, 40 tuổi, tiếp nối di nguyện người cha dành nhiều công sức tạo môi trường cho đàn chim trời sinh sống tại khu vườn gia đình.

Công ty diệt chuột T&C

 

Diet con trung