2012-02-27 3 views

답변

1

필자는 기본 시스템보다 유연성이 필요한 비슷한 문제가있었습니다.

// check each page for gossip permissions 
$wgHooks['ArticlePageDataBefore'][] = 'GossipProtection_check_permissions'; 

/** 
* ArticlePageDataBefore hook 
* 
* $article: article that is requested 
* ($fields: not important) 
*/ 
function GossipProtection_check_permissions($article, $fields) { 
    global $wgUser; 
    $title = $article->getTitle()->mTextform; 
    if(is_gossip_page($title)) 
     if(!this_user_is_allowed_on_page($title)) 
      die('You are not allowed on this page'); 
    return true; 
} 

그러나 미디어 위키의 보호 서비스를 사용하여 전원이 물론 더 우아한 : 나는 (미디어 위키 확장에 포함)이 스크립트에 의해이 문제를 해결했다. 예를 들어 허용 된 사용자에 대한 그룹을 만들 수 있습니다.

관련 문제