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

 
Một vài lưu ý cho tất cả những quảng cáo Google Adwords năm 2013

Một vài lưu ý cho tất cả những quảng cáo Google Adwords năm 2013

Sau nhiều năm phát triển Internet, có thể nói năm 2010 – 2012 là thời gian lan tỏa của công nghệ Internet tại Việt Nam và nhiều nước khác.

MacBook Air 15-inch ngấp nghé ra lò

MacBook Air 15-inch ngấp nghé ra lò

Apple chắc chắn sẽ tung ra chiếc MacBook Air 15-inch khi làm mới dòng laptop siêu mỏng này vào đầu năm 2012, theo một số nhà phân tích.

Khắc phục hỏng hóc máy in canon, epson

Khắc phục hỏng hóc máy in canon, epson

Ai cũng có lúc ghét máy in. Khi bạn cần in nhất thì lại có một bảng báo lỗi ngớ ngẩn, hay làm bạn rối tung vì bị kẹt giấy hoặc lem mực.

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

 

Diet con trung