Editing
Setting user rights in MediaWiki
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== 狀況C: 屬於managers的使用者才能觀看與編輯特定文章 === <pre> $wgGroupPermissions['*']['read'] = false; //設定未登入的匿名訪客,無法觀看任何頁面。 $wgGroupPermissions['user']['read'] = false; //設定登入的使用者,無法觀看任何頁面。除非是有在$wgWhitelistRead的頁面名稱清單內。 $wgWhitelistRead = array( "Main Page", "Special:Userlogin", "Special:UserLogout" ); //設定登入的匿名訪客 和 登入的使用者,僅能讀取的頁面名稱清單。 $wgGroupPermissions['managers']['read'] = true; //設定managers群組的使用者,可以觀看(及編輯)所有頁面。 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['managers']['official-edit'] = true; //設定登入的managers群組的使用者,可以編輯Official namespace的頁面 (例如NS_OFFICIAL:page_name)。 $wgGroupPermissions['managers']['official-talk-edit'] = true; ////設定登入的managers群組的使用者,可以編輯Official namespace的討論頁面(例如Talk:NS_OFFICIAL:page_name)。 </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]
Summary:
Please note that all contributions to LemonWiki共筆 are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
LemonWiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Current events
Recent changes
Random page
Help
Categories
Tools
What links here
Related changes
Special pages
Page information