Effective Protection Level

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

Documentation icon คู่มือการใช้งานมอดูล

  • แม่แบบและมอดูล: 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 

Tags:

🔥 Trending searches on Wiki ไทย:

พระราชพิธีมหามงคลเฉลิมพระชนมพรรษา 6 รอบ 28 กรกฎาคม 2567ขันธ์เศรษฐพุฒิ สุทธิวาทนฤพุฒิGenwit อัจฉริยะพันธุ์ใหม่ครูพิเศษจอมป่วน รีบอร์น!ข่าวช่อง 7HDประวิตร วงษ์สุวรรณการ์ตูนอินนาลิลลาฮิวะอินนาอิลัยฮิรอญิอูนหลวงปู่ดู่ พฺรหฺมปญฺโญอัลเบิร์ต ไอน์สไตน์มูฮัมหมัด อุสมานมูซาจังหวัดสระแก้วพระมหากษัตริย์ไทยมหาวิทยาลัยเทคโนโลยีพระจอมเกล้าพระนครเหนือลาลิกาอัญรินทร์ ธีราธนันพัฒน์จังหวัดราชบุรีกกจังหวัดของประเทศไทยเจนนิเฟอร์ คิ้มประเทศจีนไดโนเสาร์พระบาทสมเด็จพระจอมเกล้าเจ้าอยู่หัวเดอะ วัน เอ็นเตอร์ไพรส์สมเด็จพระที่นั่งท้ายสระทวีปยุโรปมหาวิทยาลัยศรีนครินทรวิโรฒเรวัช กลิ่นเกษรเจ้าพระยาอัครมหาเสนาธิบดี (พระราชมนู)ผู้ว่าการธนาคารแห่งประเทศไทยจังหวัดบึงกาฬรายชื่อค่ายทหารในสังกัดกองทัพบกไทยสมเด็จพระเจ้าชาลส์ที่ 3 แห่งสหราชอาณาจักรสุภาพบุรุษจุฑาเทพเมียวดีทวีปเอเชียธนาคารแห่งประเทศไทยมหาวิทยาลัยมหิดลมหาวิทยาลัยเกษตรศาสตร์รอย อิงคไพโรจน์เอาแล้วไง ยัยแฟนเก่าดันเป็นลูกสาวแม่ใหม่ประเทศแคนาดาคณะกรรมการป้องกันและปราบปรามการทุจริตแห่งชาติวอลเลย์บอลหญิงทีมชาติไทยคู่เวรอาลิง โฮลันธีรเดช เมธาวรายุทธวิธวัฒน์ สิงห์ลำพองบัตเตอร์ฟลาย (วงดนตรี)สุรยุทธ์ จุลานนท์รายชื่อตอนในเป็นต่อ (ช่องวัน)จ้าว ลู่ซือฮัน กา-อินชาลิดา วิจิตรวงศ์ทองโหราศาสตร์ไทยราชกิจจานุเบกษาดวงใจเทวพรหมฟุตซอลตลาดหลักทรัพย์แห่งประเทศไทยรายชื่อตัวละครในดาบพิฆาตอสูรฟุตซอลโลก 2021พิธา ลิ้มเจริญรัตน์ไคลี เจนเนอร์ลิซ่า (แร็ปเปอร์)เซลล์ (ชีววิทยา)2ปานปรีย์ พหิทธานุกรดวงใจเทวพรหม (ละครโทรทัศน์)รายชื่อท่าอากาศยานในประเทศไทยประวัติศาสนาคริสต์สมเด็จพระอริยวงศาคตญาณ (อัมพร อมฺพโร)หนังสือรุ่นพลอยกัญญาวีร์ สองเมืองอินดอร์ สเตเดียม หัวหมากพระบาทสมเด็จพระพุทธเลิศหล้านภาลัยพัชรวาท วงษ์สุวรรณจังหวัดระยอง🡆 More