fbpx
วิกิพีเดีย

มอดูล:Effective protection level

คู่มือการใช้งานมอดูล[ดู] [แก้] [ประวัติ] [ล้างแคช]

มอดูลนี้ส่งคืนกลุ่มผู้ใช้ที่สามารถกระทำสิ่งใด ๆ ในหน้าได้ ผลลัพท์ปัจจุบันเป็นดังนี้

  • แม่แบบและมอดูล: autoconfirmed
  • หน้าในเนมสเปซมีเดียวิกิ: sysop
  • หน้าที่เป็นหน้ารองสไตล์ชีตและจาวาสคริปต์ของผู้ใช้: interfaceadmin
  • หน้าที่เป็นหน้ารอง JSON ของผู้ใช้: sysop
  • หน้าที่ถูกป้องกัน: sysop หรือ autoconfirmed
  • หน้าที่ถูกป้องกันแบบต่อเรียง: sysop
  • ชื่อหน้าตรงกับบัญชีดำ: sysop
  • การย้ายไฟล์: uploader หรือ sysop
  • อัปโหลดไฟล์: uploader หรือ sysop
  • อื่น ๆ: * (ทุกคน)

การใช้งาน

ระวัง: มอดูลนี้ใช้งานตัวแจงส่วนที่อาจก่อปัญหาแก่เซิร์ฟเวอร์ถึง 4 ตัวในแต่ละครั้งที่เรียกใช้ โดยจะใช้มอดูลนี้เมื่อจำเป็นเท่านั้น หากไม่จำเป็นขนาดนั้นกรุณาเปลี่ยนไปใช้ title.protectionLevels แทน

จากมอดูลอื่น

ใช้:

local effectiveProtectionLevel = require('Module:Effective protection level')._main 

The function accepts two parameters. The first is a string containing the action to check, which must be one of "edit", "create", "move", "upload", or "autoreview". The second is optional, and can either be the name of the page to check, or a title returned from the mw.title functions. If the second parameter is omitted, the page being displayed is the one checked against. The return value is a string containing the name of the group required to perform the given action.

From wikitext

The parameters are the same as when it is called directly.

แม่แบบ:Tlinv 

See also

local p = {}  -- Returns the permission required to perform a given action on a given title. -- If no title is specified, the title of the page being displayed is used. function p._main(action, pagename)  local title  if type(pagename) == 'table' and pagename.prefixedText then  title = pagename  elseif pagename then  title = mw.title.new(pagename)  else  title = mw.title.getCurrentTitle()  end  pagename = title.prefixedText   if action ~= 'edit' and action ~= 'move' and action ~= 'create' and action ~= 'upload' then  error( 'First parameter must be one of edit, move, create, upload', 2 )  end  if title.namespace == 8 then -- MediaWiki namespace  if title.contentModel == 'javascript' or title.contentModel == 'css' then -- site JS or CSS page  return 'interfaceadmin'  else -- any non-JS/CSS MediaWiki page  return 'sysop'  end  elseif title.namespace == 2 and title.isSubpage then  if title.contentModel == 'javascript' or title.contentModel == 'css' then -- user JS or CSS page  return 'interfaceadmin'  elseif title.contentModel == 'json' then -- user JSON page  return 'sysop'  end  end  local level = title.protectionLevels[action] and title.protectionLevels[action][1]  if level == 'sysop' or level == 'editprotected' then  return 'sysop'  elseif title.cascadingProtection.restrictions[action] and title.cascadingProtection.restrictions[action][1] then -- used by a cascading-protected page  return 'sysop'  elseif action == 'move' then  local blacklistentry = mw.ext.TitleBlacklist.test('edit', pagename) -- Testing action edit is correct, since this is for the source page. The target page name gets tested with action move.  if blacklistentry and not blacklistentry.params.autoconfirmed then  return 'autocomfirmed'  end  end  local blacklistentry = mw.ext.TitleBlacklist.test(action, pagename)  if blacklistentry then  return 'autoconfirmed'  elseif level == 'editsemiprotected' then -- create-semiprotected pages return this for some reason  return 'autoconfirmed'  elseif level then  return level  elseif action == 'upload' then  return 'uploader'  else  return '*'  end end  setmetatable(p, { __index = function(t, k)  return function(frame)  return t._main(k, frame.args[1])  end end })  return p 

มอด, effective, protection, level, อการใช, งานมอด, แก, ประว, างแคช, แม, แบบน, ใช, ในข, อความของระบบ, การเปล, ยนแปลงแม, แบบน, ทำให, เก, ดการเปล, ยนแปลงต, อส, วนต, ดต, อผ, ใช, ของว, เด, ยในท, นท, เพ, อหล, กเล, ยงความผ, ดพลาด, การทำการเปล, ยนแปลงใด, ควรทดลองในหน,. khumuxkarichnganmxdul du aek prawti langaekhch aemaebbniichinkhxkhwamkhxngrabb karepliynaeplngaemaebbnithaihekidkarepliynaeplngtxswntidtxphuichkhxngwikiphiediyinthnthi ephuxhlikeliyngkhwamphidphlad karthakarepliynaeplngid khwrthdlxnginhnayxy sandbox khxngaemaebbkxn hruxxaccathdlxnginhnayxykhxnghnaphuichkhxngkhun oprdaecnginhnaxphipraykxnthakaraekikhmxdulnisngkhunklumphuichthisamarthkrathasingid inhnaid phllphthpccubnepndngni aemaebbaelamxdul autoconfirmed hnainenmsepsmiediywiki sysop hnathiepnhnarxngsitlchitaelacawaskhriptkhxngphuich interfaceadmin hnathiepnhnarxng JSON khxngphuich sysop hnathithukpxngkn sysop hrux autoconfirmed hnathithukpxngknaebbtxeriyng sysop chuxhnatrngkbbychida sysop karyayifl uploader hrux sysop xpohldifl uploader hrux sysop xun thukkhn enuxha 1 karichngan 1 1 cakmxdulxun 1 2 From wikitext 2 See also karichngan aekikh rawng mxdulniichngantwaecngswnthixackxpyhaaekesirfewxrthung 4 twinaetlakhrngthieriykich odycaichmxdulniemuxcaepnethann hakimcaepnkhnadnnkrunaepliynipich title protectionLevels aethn cakmxdulxun aekikh ich local effectiveProtectionLevel require Module Effective protection level main The function accepts two parameters The first is a string containing the action to check which must be one of edit create move upload or autoreview The second is optional and can either be the name of the page to check or a title returned from the mw title functions If the second parameter is omitted the page being displayed is the one checked against The return value is a string containing the name of the group required to perform the given action From wikitext aekikh The parameters are the same as when it is called directly aemaebb Tlinv See also aekikh Module Effective protection expirykhumuxkarichnganthipraktdanbnnidungmacak mxdul Effective protection level doc aek prawti phuekhiynsamarththakarthdlxngidthikrabathray srang khdlxk aelachudthdsxb srang khxngmxdulni hnayxykhxngmxdulnilocal p Returns the permission required to perform a given action on a given title If no title is specified the title of the page being displayed is used function p main action pagename local title if type pagename table and pagename prefixedText then title pagename elseif pagename then title mw title new pagename else title mw title getCurrentTitle end pagename title prefixedText if action edit and action move and action create and action upload then error First parameter must be one of edit move create upload 2 end if title namespace 8 then MediaWiki namespace if title contentModel javascript or title contentModel css then site JS or CSS page return interfaceadmin else any non JS CSS MediaWiki page return sysop end elseif title namespace 2 and title isSubpage then if title contentModel javascript or title contentModel css then user JS or CSS page return interfaceadmin elseif title contentModel json then user JSON page return sysop end end local level title protectionLevels action and title protectionLevels action 1 if level sysop or level editprotected then return sysop elseif title cascadingProtection restrictions action and title cascadingProtection restrictions action 1 then used by a cascading protected page return sysop elseif action move then local blacklistentry mw ext TitleBlacklist test edit pagename Testing action edit is correct since this is for the source page The target page name gets tested with action move if blacklistentry and not blacklistentry params autoconfirmed then return autocomfirmed end end local blacklistentry mw ext TitleBlacklist test action pagename if blacklistentry then return autoconfirmed elseif level editsemiprotected then create semiprotected pages return this for some reason return autoconfirmed elseif level then return level elseif action upload then return uploader else return end end setmetatable p index function t k return function frame return t main k frame args 1 end end return p ekhathungcak https th wikipedia org w index php title mxdul Effective protection level amp oldid 9075488, wikipedia, วิกิ หนังสือ, หนังสือ, ห้องสมุด,

บทความ

, อ่าน, ดาวน์โหลด, ฟรี, ดาวน์โหลดฟรี, mp3, วิดีโอ, mp4, 3gp, jpg, jpeg, gif, png, รูปภาพ, เพลง, เพลง, หนัง, หนังสือ, เกม, เกม