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.
localp={}-- 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.functionp._main(action,pagename)localtitleiftype(pagename)=='table'andpagename.prefixedTextthentitle=pagenameelseifpagenamethentitle=mw.title.new(pagename)elsetitle=mw.title.getCurrentTitle()endpagename=title.prefixedTextifaction~='edit'andaction~='move'andaction~='create'andaction~='upload'thenerror('First parameter must be one of edit, move, create, upload',2)endiftitle.namespace==8then-- MediaWiki namespaceiftitle.contentModel=='javascript'ortitle.contentModel=='css'then-- site JS or CSS pagereturn'interfaceadmin'else-- any non-JS/CSS MediaWiki pagereturn'sysop'endelseiftitle.namespace==2andtitle.isSubpagetheniftitle.contentModel=='javascript'ortitle.contentModel=='css'then-- user JS or CSS pagereturn'interfaceadmin'elseiftitle.contentModel=='json'then-- user JSON pagereturn'sysop'endendlocallevel=title.protectionLevels[action]andtitle.protectionLevels[action][1]iflevel=='sysop'orlevel=='editprotected'thenreturn'sysop'elseiftitle.cascadingProtection.restrictions[action]andtitle.cascadingProtection.restrictions[action][1]then-- used by a cascading-protected pagereturn'sysop'elseifaction=='move'thenlocalblacklistentry=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.ifblacklistentryandnotblacklistentry.params.autoconfirmedthenreturn'autocomfirmed'endendlocalblacklistentry=mw.ext.TitleBlacklist.test(action,pagename)ifblacklistentrythenreturn'autoconfirmed'elseiflevel=='editsemiprotected'then-- create-semiprotected pages return this for some reasonreturn'autoconfirmed'elseiflevelthenreturnlevelelseifaction=='upload'thenreturn'uploader'elsereturn'*'endendsetmetatable(p,{__index=function(t,k)returnfunction(frame)returnt._main(k,frame.args[1])endend})returnp
เมษายน 07, 2022
มอด, 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, วิกิ หนังสือ, หนังสือ, ห้องสมุด,