Editing Module:Effective protection level

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.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 23: Line 23:
return nil -- not '*'. a page not being PC-protected is distinct from it being PC-protected with anyone able to review. also not '', as that would mean PC-protected but nobody can review
return nil -- not '*'. a page not being PC-protected is distinct from it being PC-protected with anyone able to review. also not '', as that would mean PC-protected but nobody can review
end
end
elseif action ~= 'edit' and action ~= 'move' and action ~= 'create' and action ~= 'upload' and action ~= 'undelete' then
elseif action ~= 'edit' and action ~= 'move' and action ~= 'create' and action ~= 'upload' then
error( 'First parameter must be one of edit, move, create, upload, undelete, autoreview', 2 )
error( 'First parameter must be one of edit, move, create, upload, autoreview', 2 )
end
end
if title.namespace == 8 then -- MediaWiki namespace
if title.namespace == 8 then -- MediaWiki namespace
if title.text:sub(-3) == '.js' or title.text:sub(-4) == '.css' or title.contentModel == 'javascript' or title.contentModel == 'css' then -- site JS or CSS page
if title.contentModel == 'javascript' or title.contentModel == 'css' then -- site JS or CSS page
return 'interfaceadmin'
return 'interfaceadmin'
else -- any non-JS/CSS MediaWiki page
else -- any non-JS/CSS MediaWiki page
Line 38: Line 38:
return 'sysop'
return 'sysop'
end
end
end
if action == 'undelete' then
return 'sysop'
end
end
local level = title.protectionLevels[action] and title.protectionLevels[action][1]
local level = title.protectionLevels[action] and title.protectionLevels[action][1]
Please note that all contributions to Consumerium development wiki are considered to be released under the GNU Free Documentation License 1.3 or later (see Consumerium: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!

To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:

Cancel Editing help (opens in new window)