2016-10-13 1 views
0

입니다. add_site라는 모듈을 만들었습니다. 하지만 관리자 패널의 모듈 섹션으로 이동하면이 모듈에 대한 권한을 설정할 수있는 옵션이 없습니다. 따라서 익명 사용자는이 모듈에도 액세스 할 수 있습니다. 그러나 익명의 사용자가이 모듈에 액세스하는 것을 원하지 않습니다. 당신이드루팔 (Drupal에서 코드에 대한 후크 권한이 필요합니다. 코드가

my drupal .module code is here pls povide me the hook_permission code 


<?php 
// $Id: person.module 

/** 
* implements hook_menu() 
*/ 
function person_menu(){ 
    $items = array(); 
    $items['person'] = array(
     'title' => "Person", 
     'page callback' => "perso_personal_info", // after visit drupal6/person, person_personal_info() function is called 
     'access callback' => true, // must return true, otherwise it will not visible as menu item 
     'type' => MENU_NORMAL_ITEM, // drupal's default menu type 
     'weight' => '10', // we want to display person link below in our nav menu 
    );  
    return $items; // finally, do not forget to return $items array 
} 
function perso_personal_info(){ 
    $output = 'Name: Gaurav</br>'; 
    $output .= 'City: nanital </br>'; 
    $output .= 'Country: india </br>'; 
    return $output; 
} 

?> 

답변

0

내가 그것을 가지고

기능 person_permission() { 반환 배열 ( 을 설정하는 방법을 좀 도와 주실 래요 '(=> 배열 ( '제목 '=> t'내 모듈을 관리 ' 내 모듈 관리 '), '설명 '=> t (내 모듈에 대한 관리 작업 수행'), ), ); }