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

 
Cài lại mật khẩu admin cho Lion

Cài lại mật khẩu admin cho Lion

Vì lí do nào đó bạn bị mất mật khẩu admin cho Mac OS X Lion, cài mật khẩu mới bằng cách nào khi không có đĩa?

Entity Views Attach: sử dụng cho hầu hết Views trong Drupal 7

Entity Views Attach: sử dụng cho hầu hết Views trong Drupal 7

Entity Views Attach (EVA) is a wonderfully useful Drupal module which makes Views more powerful.

Hosting

Doanh nghiệp www.hostinger.vn - hỗ trợ miễn phí hosting

Tìm một free host tốc độ cao và dịch vụ tốt chắc hẳn luôn luôn là một vấn đề khó. Tuy nhiên, vừa qua, seoweb24h được biết một nhà cung cấp host miễn phí khá nổi tiếng hostinger vừa cho ra mắt phiên bản tiếng Việt, và hỗ trợ người dùng tại Việt Nam.

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

 

Diet con trung