14,952
edits
(→相關資料) |
No edit summary |
||
| Line 2: | Line 2: | ||
This is partial translation of Meta:[http://meta.wikimedia.org/wiki/Setting_user_rights_in_MediaWiki Setting user rights in MediaWiki]. You may click the link for the latest information. Please notice that the '''translated/derivated content is available under [http://www.gnu.org/copyleft/fdl.html GNU Free Documentation License]''' which the same with the original work. | This is partial translation of Meta:[http://meta.wikimedia.org/wiki/Setting_user_rights_in_MediaWiki Setting user rights in MediaWiki]. You may click the link for the latest information. Please notice that the '''translated/derivated content is available under [http://www.gnu.org/copyleft/fdl.html GNU Free Documentation License]''' which the same with the original work. | ||
= MediaWiki 1.15 = | |||
== 修改 LocalSetting.php == | |||
=== 狀況: 屬於managers的使用者才能觀看與編輯特定文章 === | |||
(例如offical:page) | |||
<pre> | |||
$wgGroupPermissions['*']['read'] = false; //設定未登入的匿名訪客,無法觀看任何頁面 | |||
$wgGroupPermissions['user']['read'] = false; //設定登入的使用者,無法觀看任何頁面。 | |||
$wgWhitelistRead = array( "Main Page", "Special:Userlogin", "Special:UserLogout" ); //設定登入的使用者僅能讀取的頁面名稱清單 | |||
define("NS_OFFICIAL", 100); | |||
define("NS_OFFICIAL_TALK", 101); | |||
$wgExtraNamespaces = | |||
array(100 => "Official", | |||
101 => "Official_talk", | |||
); | |||
$wgNamespaceProtection[NS_OFFICIAL] = array( 'official-edit' ); | |||
$wgNamespaceProtection[NS_OFFICIAL_TALK] = array( 'official-talk-edit' ); | |||
$wgGroupPermissions['manager']['official-edit'] = true; //設定登入的manages群組的使用者,可以編輯Official namespace的頁面。 | |||
$wgGroupPermissions['manager']['official-talk-edit'] = true; ////設定登入的manages群組的使用者,可以編輯Official namespace的討論頁面。 | |||
</pre> | |||
參考資料: | |||
# [http://www.mediawiki.org/wiki/Manual:$wgNamespaceProtection Manual:$wgNamespaceProtection - MediaWiki] | |||
# [http://www.mediawiki.org/wiki/Manual:Preventing_access#Restrict_viewing_of_all_pages Restrict viewing of all pages] | |||
= MediaWiki 1.5+ = | = MediaWiki 1.5+ = | ||